playMaker

Author Topic: Toggle Between two rotations using Set Rotation  (Read 723 times)

Ghettokon

  • Playmaker Newbie
  • *
  • Posts: 8
Toggle Between two rotations using Set Rotation
« on: March 24, 2021, 08:39:42 PM »
Hi all,

I am trying to toggle the switch between 2 rotations (X angle = -50 and -130) using Set Rotation every 3 secs. However, it seems the angle is not being updated correctly. Here is a video of it. What did I do wrong?

I am using Unity:Unity2019.3.6f1, PlayMaker:1.9.0.p20


Thanks for your time,
Best,
« Last Edit: March 24, 2021, 09:23:59 PM by Ghettokon »

Ghettokon

  • Playmaker Newbie
  • *
  • Posts: 8
Re: Toggle Between two rotations using Set Rotation
« Reply #1 on: March 24, 2021, 09:19:59 PM »
I set values for XAngle, YAngle, and ZAngle instead of leaving Y and Z to None. This way it works correctly. I then open the Set Rotation script and did a few Debug.Logs and found out when I left Y and Z to none before, my YAngle is toggling between 0 and 180 (or 90 and 270) somehow, and that caused Xangle updates not being persistent. Did I miss a setting somewhere?

« Last Edit: March 24, 2021, 09:22:34 PM by Ghettokon »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Toggle Between two rotations using Set Rotation
« Reply #2 on: March 25, 2021, 07:46:54 AM »
Hi.
I'm not sure why its doing this but you should try setting the switch object inside a empty parent and then rotate the parent and make sure the parent scale is 1,1,1