Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: mikejkelley on January 15, 2014, 06:40:04 PM

Title: [SOLVED]Vid: Angle is wrong, operator executing prematurely,
Post by: mikejkelley on January 15, 2014, 06:40:04 PM
So much is going wrong. It's easier to explain in a short video.

Please assist, this is standing between me and game completion.

http://www.youtube.com/watch?v=QK_DqKXN5X4&feature=youtu.be
 (http://www.youtube.com/watch?v=QK_DqKXN5X4&feature=youtu.be)
Title: Re: Vid: Angle is wrong, operator executing prematurely, variables resetting...
Post by: redikann on January 15, 2014, 11:13:32 PM
I am not going to tell you this is a correct solution but it is something I've used for a work around before. If I remember right I used an empty to always look at a target I needed to know an angle to and then that provided me with a correct rotation to copy  from. I seem to remember 'get angle to' action always returned 0 - 180 no matter what.
Title: Re: Vid: Angle is wrong, operator executing prematurely, variables resetting...
Post by: redikann on January 15, 2014, 11:56:36 PM
Alright so 1 of the problems is your switch statement. You are immediately adding 90 so you will never be less than 90. Adding 90 to your original angle wont help because "Get Angle To" will always return 0 to 180.Think of it as a mirror, you might think 90 and 270 would be left and right, but get angle to will always treat left and right as 90. It does seem that your current logic will always fire and exit because your switch statement will be decided before your Get angle to has finished.
While I believe your current logic will never be right I am curious if you leave your Switch action off and change that state to an "Action Sequence" would your 2 variable add 90 correctly.
Title: Re: Vid: Angle is wrong, operator executing prematurely, variables resetting...
Post by: mikejkelley on January 16, 2014, 02:04:48 AM
Cool, thanks that would explain a lot, I'll try this out first thing tomorrow!
Title: Re: [SOLVED]Vid: Angle is wrong, operator executing prematurely,
Post by: mikejkelley on January 16, 2014, 10:32:39 PM
Yeah, I needed to use get rotation instead of get angle. Thanks!