Author Topic: SGSK - Turning Torque axis problem  (Read 3117 times)

bariscigal

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 15
    • View Profile
SGSK - Turning Torque axis problem
« on: March 11, 2014, 04:30:15 PM »
Hi,
I have been using this kit for a long time now. It is pretty in the core of my game now. First i must thank you :) .
I made huge tweaks to the system but the physics and camera chase scripts are pretty untouched.
 
I have asked a similar question before but i noticed a big thing today.

Problem is the torque for turning are applied based on the view angle.

The steering and maneuver systems are mainly untouched. I have changed turn and move inputs mainly.

There is no problem when main cam is following(chasing) the target from back of the player. But when camera is in front of the player in a 45 degree angle when i set the input for like roll (turn.z) it starts to turn in the forward vector of the "camera.forward"not the "gameobject.rigidbody.forward" vector.

I was having this problem since the start but haven't thought about it as a big issue because the torque error is minimal in normal mode.

Any ideas why this is happening?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: SGSK - Turning Torque axis problem
« Reply #1 on: March 11, 2014, 08:35:30 PM »
I'm not sure which version you have there, but the updated SGSK (that uses NGUI) doesn't use the camera's look vector anywhere. The torque is applied in Spaceship.UpdateTorque, which is done by applying it to the rigidbody as-is via AddRelativeTorque.

bariscigal

  • Newbie
  • *
  • Thank You
  • -Given: 2
  • -Receive: 0
  • Posts: 15
    • View Profile
Re: SGSK - Turning Torque axis problem
« Reply #2 on: March 13, 2014, 10:02:48 AM »
Thank you for reply. it turns out a problem caused by me.