Hey,
so I’m trying to reset the rotation of my board-gameobject, with walls as child-objects. There is a ball which the user navigates around a labyrinth and if the ball hits a hole - the ball should have its velocity and position reset and the board should have it rotation reset.
For some reason, I cannot reset the rotation of the board in my Reset-method, which is called when a hole is hit.
this is my code:
public void Reset(){
print ("Reset-method called");
count++;
setCountText ();
board.transform.rotation = Quaternion.identity;
ball.GetComponent<Rigidbody>().velocity = Vector3.zero;
ball.GetComponent<Rigidbody>().angularVelocity = Vector3.zero;
ball.transform.position = new Vector3 (startZone.transform.position.x, ballY, startZone.transform.position.z);
}
ah ok. In this specific scenario I have a pool of particles. It was screweing up their animation when I deactivated them and tried to restart it all again, and was wondering whether it was a good idea just to turn the sprite renderer off and leave them being moved via their script, so that when I turn the renderer back on they will still be there. But, that would mean I would be leaving it on for all of the space ships, as they will all be created as a pool at the start of the level and intended as a webGL game.
– GameDevSA