|
Hi, I am new to unity and c#, I would like to know weather or not it is possible to get a script like this to actually work properly :)
(comments are locked)
|
|
It looks like you are trying to shoot straight forward from you character. clone.transform.TransformDirection(Vector3.forward * 10) Multiplying by 10 changes the magnitude / length of the vector, but doesn't change the direction so isn't needed. Here, you should be changing your clone's position, not the original projectile (clone.transform.position = objPlayer.transform.position) You need to make your projectile move! Check out the documentation for ConstantForce: // Moves the rigidbody upwards in world coordinates constantForce.force = Vector3.up * 10; You'll need to add a RigidBody component to you projectile, and may want to uncheck "use gravity" One tip, Debug.drawRay() and Debug.drawLine() are SUPER useful, I always make sure that I've got the geometric problem solved before trying to make projectiles follow along the paths. You'll need to make your projectile move along Thank you! worked perfectly :)
Jan 25 '12 at 03:44 PM
MithosAnnar
(comments are locked)
|
