playMaker

Author Topic: How to get an Int (1 or -1) depending on direction ? [SOLVED]  (Read 4369 times)

curb47

  • Sr. Member
  • ****
  • Posts: 256
Re: How to get an Int (1 or -1) depending on direction ?
« Reply #15 on: June 26, 2020, 04:00:32 PM »
My brain's fried. I'll pick this up another time.

Thanks.

curb47

  • Sr. Member
  • ****
  • Posts: 256
Re: How to get an Int (1 or -1) depending on direction ?
« Reply #16 on: June 26, 2020, 04:01:44 PM »
Orientation of ship is fine.

curb47

  • Sr. Member
  • ****
  • Posts: 256
Re: How to get an Int (1 or -1) depending on direction ?
« Reply #17 on: June 27, 2020, 02:22:01 AM »
HOORAH!!!!!!! I"VE DONE IT!!!!!

So, after all that, I ended up going back to trying Get Rotation, and setting a variable on the Y Axis, and using Float Compare to set Boost Left or Boost Right.

My mistake when I tried to use it before, was comparing the float value to Zero, when I expected the Get Rotation variable to give me -90 (facing left) or 90 (facing right).

It threw me when the Get Rotation variable gave me 270 (left) and 90 (right), and I had a mental block thinking it had to be compared to Zero... But, all I had to do after all, was set the Float Compare value to 91 , not Zero !!!!

So, it was set up as Less than 91 - boost Right, Greater than 91 - boost Left.

I've now got a really cool control system, using Forces and physics, gravity etc.

I'm so happy!

Thore... thank you for all your input and suggestions, I've certainly been forced to explore a lot of different actions and logic break-downs in the quest to resolve this problem, which is a great way to learn.

We learn the most when we're faced with brain-melting challenges.

This has now been officially SOLVED ! Boom!!!

Thore

  • Sr. Member
  • ****
  • Posts: 480
Re: How to get an Int (1 or -1) depending on direction ?
« Reply #18 on: June 27, 2020, 08:17:46 AM »
Yay! You can edit your first post and append [SOLVED] in the headline :)