playMaker

Author Topic: Set Rotation Action: Negative number Not working [SOLVED]  (Read 2697 times)

Sly

  • Full Member
  • ***
  • Posts: 124
Set Rotation Action: Negative number Not working [SOLVED]
« on: January 15, 2015, 09:51:38 AM »
Hello,

I'm actually trying to set a negative rotation to a gameobject, but it's not working.

I explain the situation:
For prevent multiple calculation in my graph, I want to set a rotation to a gameobject regarding an other one. I want my first gameobject to have the opposite Y coordinate than the other one.
Example: my second gameobject has 90° so the other one must have -90°

For this I'm multiply my second GameObject Y by -1 for having the opposite. With the calculation, it's working. But when I use SetRotation action, it set the correct value without the "-" (without the negative symbol).

Why it's doing this? Is it a bug or a math/geometry logic?
« Last Edit: January 20, 2015, 04:22:08 PM by Alex Chouls »

600

  • Moderator
  • Hero Member
  • *****
  • Posts: 716
    • Flashing Lights
Re: Set Rotation Action: Negative number Not working
« Reply #1 on: January 15, 2015, 10:15:05 AM »
Hello,

I think it has something to do with Unity+geometry, I can't give you the exact term for this, but when I interpolate a float from 0 to -90 it works with Set Rotation, but in some cases with a hard value I need to subtract 90 from 360, then for the opposite game object I have 270. A circle have 360 at the same point as zero.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Set Rotation Action: Negative number Not working
« Reply #2 on: January 15, 2015, 10:25:44 AM »
This works fine. You can multiply a float -1 and get the opposite which can be injected directly as a rotation. The Transform component may report a different value (-90 might become 270) but it will be the correct rotation.

Are you sure you aren't overriding the rotation or corrupting the values somewhere in the workflow?
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Set Rotation Action: Negative number Not working
« Reply #3 on: January 15, 2015, 10:51:52 AM »


Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Sly

  • Full Member
  • ***
  • Posts: 124
Re: Set Rotation Action: Negative number Not working [SOLVED]
« Reply #4 on: January 20, 2015, 02:29:54 PM »
Yes, you're right. My test graph was so huge :/
It explain why my value were finally wrong.

Thanks to take time to help me!