So instead of a cucumber I am using a spear however its normal orientation is so:
Given its orientation I told it to rotate -52 degrees in the z direction leaving me with this:
Now the problem comes when I tell it to move across the screen it starts correctly but then since I am telling it to move right it starts to move down to the right (since the right axis is down to the right).
So I have been trying to figure how to code in the correct movement
[Range(0f, 10f)] [SerializeField] float spearSpeed = 1f;
void Update()
{
var rotation = new Vector2(spearSpeed * Time.deltaTime, spearSpeed * Time.deltaTime);
transform.Translate(Vector2.right * spearSpeed * Time.deltaTime);
transform.Translate(Vector2.up * spearSpeed * Time.deltaTime);
}
But I still get the same result of down to the right. I also tried an animation of telling the spear to rotate right at the beginning but then the spear will still fall down to the right instead of straight. Any ideas on how to get it to the spear to still move to the right without going down?