playMaker

Author Topic: Rotating Issue  (Read 1743 times)

misterjuly

  • Sr. Member
  • ****
  • Posts: 334
Rotating Issue
« on: July 22, 2021, 08:46:22 PM »
Hello,

I am using the Tween rotate action and it is working except for one thing. I have 4 sets of two states (the first state of each set is get key down action) and the second one is setting the vector 3 value and rotating the world (the mechanic of my game). The first set's vector 3 value is set to -90, then second set is -180, third is -270, and lastly 0. This works except for the fact that whenever the -270 state triggers, it rotates a little bit in the opposite direction first and then rotates normally. This is a minor issue, but is bugging me to no end. How do I go about fixing this? Thanks!

John Bassi

misterjuly

  • Sr. Member
  • ****
  • Posts: 334
Re: Rotating Issue
« Reply #1 on: July 22, 2021, 09:39:12 PM »
I just wanted to update this. I am still having the issue but changed the fsm from set vector 3 value actions to add vector 3 actions. Still the same problem but now I only have a few states instead of like 8 of them. Thanks!

misterjuly

  • Sr. Member
  • ****
  • Posts: 334
Re: Rotating Issue
« Reply #2 on: July 24, 2021, 09:18:59 PM »
Bump.

misterjuly

  • Sr. Member
  • ****
  • Posts: 334
Re: Rotating Issue
« Reply #3 on: July 27, 2021, 03:10:43 PM »
Anyone?

misterjuly

  • Sr. Member
  • ****
  • Posts: 334
Re: Rotating Issue
« Reply #4 on: July 30, 2021, 08:15:17 PM »
Hello?

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Rotating Issue
« Reply #5 on: August 02, 2021, 02:06:21 PM »
Can you post a screenshot of the FSM? It's not quite clear. Generally, imperfections happen due to float imprecision.
Available for Playmaker work

misterjuly

  • Sr. Member
  • ****
  • Posts: 334
Re: Rotating Issue
« Reply #6 on: August 02, 2021, 07:33:01 PM »
This is the FSM. As you can see, it is rather complicated. But basically the way it works is I have trigger2d events with tags (each direction has a tag, so for example, the ground has a tag the left wall has a tag, the right wall has a tag and the ceiling has a tag. The trigger then activates when the player touches the wall and then it checks for a key press. It then adds/subtracts 90 (depending on the direction) to the variable and rotates the world and the camera. One thing I have noticed is that sometimes when my level rotates it the rotation counter in unity in the upper right corner counts the opposite direction then goes the right way. Like it counts up or down in the wrong direction then corrects it. I don't think the wiring of the FSM is wrong because I tried making it add negative instead of positive (or vice versa) and it made the level rotate wrong and everything was thrown off. Any thoughts? I think I need the FSM to be as big as it is so that the tags and rotation can be right. Thanks!

misterjuly

  • Sr. Member
  • ****
  • Posts: 334
Re: Rotating Issue
« Reply #7 on: August 07, 2021, 11:54:08 AM »
Bump.

misterjuly

  • Sr. Member
  • ****
  • Posts: 334
Re: Rotating Issue
« Reply #8 on: August 07, 2021, 11:55:42 AM »
If there’s a better way to do this, I’m open to it, I just wasn’t sure how else to go about it. Thanks!

etbandung

  • Guest
Re: Rotating Issue
« Reply #9 on: August 09, 2021, 05:27:05 AM »
still observing with u mate