Below is the code I'm using. Basically, it is a ball with the sprite of a tiny spaceship that rotates around a ring. It has a trail renderer attached and when I change the direction the trail comes out the top in the wrong direction. I need to know how to flip the ship to match the trail.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BallRotation : MonoBehaviour
{
[SerializeField] private float _speed;
private void FixedUpdate()
{
transform.Rotate(0, 0, _speed * Time.deltaTime);
}
public void ChangeDirection()
{
_speed = -_speed;
}
}
Hard to pinpoint ur error without knowing further details. Is your "ball" a 3D Sphere or a 2D Circle? What component is used to display your spaceship image?
if its the SpriteRenderer, you can get a reference to that and flip the sprite