Quantcast
Channel: Unity Forum
Viewing all articles
Browse latest Browse all 1466670

World Space axis to Local Space

$
0
0
Hi, so I'm trying to make a RPG launcher to shoot the projectile. I've attached a Rigidbody to projectile. The projectile is a child of the Main RPG prefab. I need it to move forward on its local axis (Way where the camera is directed) but it moves forward in the World Space. So I need to know how to move it through Local Axis. Here's the code, Thanks.

Code (JavaScript):
  1. #pragma strict
  2.  
  3. var projectile : Rigidbody;
  4. var speed : int = 500;
  5.  
  6. function Update ()
  7. {  
  8.      if(Input.GetButton("Fire1"))...
World Space axis to Local Space

Viewing all articles
Browse latest Browse all 1466670

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>