Very simple.
- I created a main character
- I make it a child of a vehicle game object using:
Destroy (player.GetComponent ());
player.transform.SetParent(this.transform,true);
player.transform.position = posicion_de_montar.transform.position; - As soon as I do that the vehicle begins strangely moving/listing and turning without any user input.
I trigger the parenting with an “OnTriggerEnter” on the vehicle.
I get my player game object with:
player = GameObject.FindGameObjectWithTag (“Player”);
In case it makes any difference I’ll mention that I did scale up the player game object, neither object has a position of 0,0,0, both have rotation 0,0,0, and the buttons in the top left corner are set to pivot and global.
I know I’m a super novice at this. Any help would be appreciated.
Thanks in advance.