This should be very simple to do but i cant find the way to do it
I am trying to use a ‘regular’ javascript library called finite-state-machine
(https://github.com/jakesgordon/javascript-state-machine)
- I downloaded the javscript file on my script project folder
- On the play canvas entity code I use:
var engine = pc.createScript(‘animation’);
engine.attributes.add(‘stateMachine’, { type: ‘asset’, assetType: ‘script’, array: false }); - Drag and drop the assigned script as a parameter of engine.
var StateMachine = self.stateMachine.resource;
self.stateMachineApplication = StateMachine.create({
I also notice that external javascripts not formated as an entity script are not recognized…
A tutorial should be nice as this stuff should be basic and no expect the developer to port stuff into playcanvas style scripts. thanks