constrain self rotation to self X position
I am trying to have an actor (ship) have a different rotation for its position X. Ship moves side to side on X axis.
Ive tried to make 6 rules in ship. If ship is in a certain x range, then change its rotation. So if ship X position is between 120-128 then change its rotation to 317. 6 different zones give six different rotation positions. This is not consistent or works well if ship is moving quickly.
I tried graphing the position against rotation. Its an odd curve as we are dealing with 360 degrees. Not a linear relationship to use simple algebra.
Lastly I used actors. If ship collides with different actors it will change its rotation. These are placed along the x axis. This works but not a smooth tight mechanic.
I am hoping this picture will clarify what I am trying to do.
Any thoughts?
Thank-you
Comments
Constrain Rotation to (X -375)/5
That is simple algebra. Haha. I will try that when I'm home. Thanks.
I have university math but 25 years ago....... I might bother you to show the logic there but I will try it first.
wish I read this earlier, could have helped you out Socks is right, the divided by five could actually be changed to any number based on preference of look, I believe
Works great. Thanks!!!!!
You could also use rotate to position.
Hey Dwayne! Just got your message on my message board. To be honest didn't know that was a thing until today haha. Do you mind emailing or posting your question. I'm not sure if you're having trouble replicating what is happening in the video or if you want help understanding the code (which you have or not?).