playMaker

Author Topic: Slowly rotating an object to match another object's rotation[SOLVED]  (Read 2044 times)

Caffeen

  • Playmaker Newbie
  • *
  • Posts: 10
Hi, I'm pretty new to Playmaker, and I've been trying to redo a project using Playmaker. I have an object that the player can rotate left and right, and I want a second object to slowly rotate to match the rotation of the first object. I used Quaternion.RotateTowards in my old script, and that worked perfectly, but I can't for the life of me figure out how to create the same behavior in Playmaker.

Thanks!
« Last Edit: January 11, 2014, 02:40:03 PM by Caffeen »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Slowly rotating an object to match another object's rotation
« Reply #1 on: January 06, 2014, 08:53:01 AM »
Hi,

 you'll need the quaternion package from the wiki:

https://hutonggames.fogbugz.com/default.asp?W967

Essentially you can use QuaternionSlerp to achieve the same as Quaternion.RotateTowards. however if it's still this very function you need, let me know, I'll add it to the package.

bye,

 Jean

Caffeen

  • Playmaker Newbie
  • *
  • Posts: 10
Re: Slowly rotating an object to match another object's rotation
« Reply #2 on: January 06, 2014, 05:51:05 PM »
Oooh, great, thanks!! I didn't even know that existed. But actually, yeah, Slerp was the first thing I had tried prior to Playmaker, and it didn't give me the desired effect. (Takes way longer than intended, and the rotation angles never actually match up, which is essential.) So Quaternion.RotateTowards being added would actually be ideal.

Thank you for your response!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Slowly rotating an object to match another object's rotation
« Reply #3 on: January 10, 2014, 05:54:08 AM »
Hi,

 ok, I have added that RotateTowards action, please redownload the package from the wiki:

https://hutonggames.fogbugz.com/default.asp?W967

bye,

 Jean