- Home /
The question is answered, right answer was accepted
bullet problems
hi im creating a game for my university course and ive run into a small problem ive got this code for a bullet but for some reason its not doing anything. ive set the speed to 10 and when i press play it should move forward but it doesnt can someone take a look for me
var bulletSpeed: int;
function update(){
amtToMove = bulletSpeed * Time.deltaTime;
Transform.translate(Vector3.forward * amtToMove);
}
huh, you are animating the bullet ?
do you know about rigidbody and using the physics engine?
$$anonymous$$gest you add "Debug.Log" statements to quickly find your problem. Did you forgot to attach the script, etc ?
Answer by robhuhn · Oct 22, 2012 at 12:19 PM
I think there are just upper- / lower case issues. I'm not used to JS but it should be
function Update()
{
amtToMove = bulletSpeed * Time.deltaTime;
transform.Translate(Vector3.forward * amtToMove);
}
Follow this Question
Related Questions
Shoot an object and have it move based on rotation 1 Answer
Custom movement script problems 1 Answer
Camera relative movement 0 Answers
2D Sending Object From One Place To Mouse Position. 1 Answer