constrain self rotation to self X position

GnarlyGnarly canadaMember Posts: 840

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

Image and video hosting by TinyPic

Comments

  • SocksSocks London, UK.Member Posts: 12,822

    Constrain Rotation to (X -375)/5

  • GnarlyGnarly canadaMember Posts: 840

    @Socks said:
    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.

  • zweg25zweg25 Member Posts: 738

    wish I read this earlier, could have helped you out :smile: Socks is right, the divided by five could actually be changed to any number based on preference of look, I believe

  • GnarlyGnarly canadaMember Posts: 840

    Works great. Thanks!!!!!

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,879

    You could also use rotate to position.

  • zweg25zweg25 Member Posts: 738

    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?).

Sign In or Register to comment.