Issue with Point towards anyone have a workaround?

ggiersdorf

  • Posts: 52
I have a character which spins around when collides with an enemy. I set it to do a 360 rotation which works, however if this happens in quick succession the actor ends up pointing in some varying degree not set to 360. I have even tried adding a point actor to 360 command after the collision but it doesnt work.

I than add an ALWAYS IF command and said if this flag is set than always point to 360 and it works. However when the game is over it gives me a TypeError 1009 Cannot access a property or method of a null object reference. at MethodInfo-3626()[Source/scripts/SceneEvents_0.hx:135]
   at com.stencyl::Engine$/invokeListeners2()[C:\Program Files (x86)\Stencyl\plaf\haxe\lib/stencyl/1,00/com/stencyl/Engine.hx:3853]
   at com.stencyl::Engine/update()[C:\Program Files (x86)\Stencyl\plaf\haxe\lib/stencyl/1,00/com/stencyl/Engine.hx:2297]
   at com.stencyl::Engine/postUpdate()[C:\Program Files (x86)\Stencyl\plaf\haxe\lib/stencyl/1,00/com/stencyl/Engine.hx:2585]
   at com.stencyl::Engine/onUpdate()[C:\Program Files (x86)\Stencyl\plaf\haxe\lib/stencyl/1,00/com/stencyl/Engine.hx:2578]

I have tried everything I can think of but cant seem to find a way to fix this. Is this a bug in Stencyl 3.0??

SadiQ

  • Posts: 1795
Can't you just check if you're spinning when you collide (using [turning Speed of <self>])? That way you could just ignore the collision when that happens.
Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

ggiersdorf

  • Posts: 52
No the speed has nothing to do with it. It should complete a 360 spin and than point to the original direction (360) each time it spins. However if you tap space bar fast while its spinning it goes wonky sometimes and changes the degree. I guess I could put a timeout value after the collision so it would not accept space bar command for x seconds to allow the spin to complete. I will try that and see what happens.