Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: Clockwork Wolf on June 06, 2013, 11:49:20 PM
-
Hello all!
I'm encountering an odd crash in Unity, and I'm wondering if it's because I'm not using the touch events correctly?
I have a cube parented to the mainCamera, which has a fsm using touch object. Upon detecting a touch on the cube, I move to another state which rotates a cube in the scene. It returns to the wait state upon touch end, else it continuously rotates the cube.
The also exists a gameObject with an FSM that I am using to detect finger drags along the screen with Touch Event, and then moves to a state that drives the rotation of a null. With the later FSM engaged, it tends to crash Unity on the phone or tablet (Nexus 4, Kindle Fire HD)
I can't seem to figure out why - is this because the events are overlapping?
Please find attached a bare bones unity file, hopefully the playmaker FSMs come through properly.
I've also got an unlisted youtube video (http://youtu.be/8yweM88WgpQ) demonstrating this crash. Thanks for any pointers!
-
Hi,
ok few things:
-- don't check "normalize" on the action "get touch info", this will give you an output ranging from 0 to 1 ( 1 being the width or height of the screen).
-- don't use the delta time of the "get touch info" since you have ticked "Per seconds" in the "rotate" action ( so get rid also of the float divide"
once you do that, everything is much better and dragging works as expected.
bye,
Jean
-
Hi Jean, thanks for the help! I will try your suggestions and let you know.
Cheers!
-
Hi Jean!
I tried your suggestions and they worked perfectly! Thank you so much.
I think I understand why we do not need to use the change in time when using the seconds checkbox, but why would the things I'd originally done cause the crash?
It's not a divide by zero or floating point precision thing, is it?
-
Hi,
Yes, it was actually, simply because you where doing the wrong set of procedures.
did you got it working?
bye,
Jean
-
Hi Jean,
Yes it is all working, thanks alot for your help. I wish I had unity pro, the debug over usb may be helpful in this case. Thanks again!