Hello guys i have a little problem, when i try to access the script from other script, it somehow doestn work and i cant find whats wrong. here’s what console says
and here is the code
Hello guys i have a little problem, when i try to access the script from other script, it somehow doestn work and i cant find whats wrong. here’s what console says
and here is the code
Try using the following line and it should work
var gameMovementRef = entity.other.script.playerMovement;
gameMovementRef.setState('dance.glb');
Uncaught TypeError: Cannot read property ‘script’ of undefined
Still the same
I’m not sure if you need the ‘other’ in there for triggers. Does it still say that if you do “entity.script.playerMovement.setState(‘dance.glb’);”?
It’s saying that entity.other is not defined
That was the issue, now it is working, thanks:)
No problem!