- Home /
Multiples Trails and multiples movements
Hello People i have a problem i have a rectangle that goes down and rotates and im using trails for make a visual smooth movement, the problem is that i don't how to block trails position or make work properly as i want here is my script and a picture, does anyone knows a way to make it work ?
public Rigidbody2D rb; void Start() { if (Obstacle.instance == null) { Obstacle.instance = this; } else if (Obstacle.instance != this) { Destroy(gameObject); Debug.LogWarning("Obstacle ha sido instaciando mas de una vez esto no deberia pasar"); } // trailRend = GetComponent<TrailRenderer>(); rb = GetComponent<Rigidbody2D>(); transform.parent = null; } void Update() { rb.velocity = new Vector2(0, speed * -1); if (RotateObstacle == true) { /*BasicTrail.SetActive(false); TrailRotate1.SetActive(true); TrailRotate2.SetActive(true);*/ transform.Rotate(new Vector3(0.0f, 0.0f, RotateSpeed * Time.deltaTime)); } /*else if (RotateObstacle ==false ) { BasicTrail.SetActive(true); TrailRotate1.SetActive(false); TrailRotate2.SetActive(false); }*/ }
First, if you could check your writing to make the description of your problem a little clearer, and also properly format your code.
Your answer
Follow this Question
Related Questions
how to rotate velocity/ tying movement to camera 0 Answers
velocity direction 1 Answer
I WILL GIVE YOU 3 DOLLARS to answer this constantforce question 4 Answers
Trail renderer on top of player object 0 Answers
Trails in just one direction 1 Answer