what does youre projectile.cs script look like?
it should be something like this:
public class Projectile : MonoBehaviour {
public float speed, damage;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
transform.Translate(Vector3.right * speed * Time.deltaTime);
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Projectile : MonoBehaviour {
public float speed, damage;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
transform.Translate(Vector3.right * speed * Time.deltaTime);
}
}
I can reproduce this behaviour by unticking the tick against the Projectile script component on the Courgette prefab for instance. The courgette will appear and then just spin in one place.
The reason I asked you to post the code was just in case you had a lower-case U in Update etc, often case-sensitivity is over-looked.
So, can you confirmed that the GameObject you are testing has the Project.cs script attached to it.
I can also reproduce this behaviour by not setting a Speed for the projectile in the Inspector, can you confirm that the instance of the GameObject you are testing has this specified also.
It looks like an animation issue. When I disable animation, both projectiles are moving smoothly forward. With animation enabled, I noticed that there is a stop at the very end of the rotation. If I can get rid of it, it would be smooth.
Changing from clamped auto to just auto didn’t stop horizontal movement for zucchini, but did stop it for axe.
There has to be something else going on there then as well, you would expect the same behaviour for both surely, as the animation should be effectively the same, e.g. just rotate.
If you zip up the project and make it the link available here I will happily take a look to see if I can spot anything.
I think I can explain the difference between your zucchini and your axe.
If you open scene 02 Level_1 and select the zucchini, look at the details in the Animation;
Now select the axe, and look at the details;
Note how for the zucchini you have applied the rotation to the body child GameObject, but for the axe you have applied it to the main axe GameObject. You get a hint in the Inspector also;