Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
transform.forward is zero?
#1
I'm working on integrating Curvy into my 2D space shooter game. I have some ships currently set to a forward direction of 0,-1 so they move down in the Y direction. These work great by applying a force in the forward direction * speed such as



Code:
lasers[laserIndex].rigidbody2D.AddForce(transform.forward * 3500.0f);


However, when I have a ship following a CurvySpline, it's transform.forward.x and transform.forward.y always equal zero and adding force just ends up with the projectile not moving at all. How do I get the facing direction of an object following a CurvySpline so I can shoot my projectiles in the correct direction?
Reply


Messages In This Thread
transform.forward is zero? - by magique - 11-30-2014, 03:11 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How do I make the computer ignore it's parent transform? eastes 3 7 04-06-2022, 12:16 PM
Last Post: _Aka_
  Connect knots to transform BanksySan 3 1,181 01-11-2021, 08:06 AM
Last Post: _Aka_
  Rigidbody or Transform Movement ATHellboy 10 6,575 02-04-2020, 08:37 PM
Last Post: _Aka_
  Generating multiple object on changing transform jawadkhan.9026 12 10,547 09-06-2019, 09:39 PM
Last Post: _Aka_

Forum Jump: