playMaker

Author Topic: Rotation exact 90 degree problem.[SOLVED]  (Read 2513 times)

neowings

  • Playmaker Newbie
  • *
  • Posts: 25
    • View Profile
Rotation exact 90 degree problem.[SOLVED]
« on: April 14, 2013, 06:04:00 AM »
Hi,

I'm making AI right now, The Ai is the Robot Guard which is standing and turn 90 or -90 degree to search player. I'm simply using 'Rotate' action with 'Every Frame' option.

To turn 90 or -90 degree, I set 3 degrees per frame because 1 sec is 30 frames. However, it doesn't work well, every time current angle is different.
Is my math wrong?

I searched related problem of get 90 degrees rotation. But my situation is little bit different. The AI has to rotate 90 or -90 degrees and Stop in every time for detecting player. setting with 'Animation Float' and 'Set Rotation' actions are not for my Ai.
http://hutonggames.com/playmakerforum/index.php?topic=2173.msg9572#msg9572


Thank you.
« Last Edit: April 15, 2013, 06:10:25 AM by neowings »

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2488
  • Yup.
    • View Profile
    • Cleverous
Re: Rotation exact 90 degree problem.
« Reply #1 on: April 14, 2013, 06:05:59 AM »
use iTween Rotate Add instead.

neowings

  • Playmaker Newbie
  • *
  • Posts: 25
    • View Profile
Re: Rotation exact 90 degree problem.
« Reply #2 on: April 14, 2013, 06:35:29 AM »

Thanks for reply my question, and I added action "iTween Rotate Add".
But rotating exactly 90 degree is still not working. Probably math mistake of rotate degree per frame within 1 second.


neowings

  • Playmaker Newbie
  • *
  • Posts: 25
    • View Profile
Re: Rotation exact 90 degree problem.
« Reply #3 on: April 15, 2013, 06:09:38 AM »
Ah ha! I should Turn "Stop on Exit" Check Box off.
Now it works 100% well.

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3632
  • Official Playmaker Support
    • View Profile
    • LinkedIn
Re: Rotation exact 90 degree problem.[SOLVED]
« Reply #4 on: April 15, 2013, 07:20:25 AM »
Hmmm, sounds like a bug. Maybe stop on exit skips setting the rotation in the last frame... I'll look into it...