Hello folks!
Apparently when i try to transform my Character with an moving Object (vehicle) it’s not transforming at all.
So the following script is being called once a Character tries to enter a Vehicle.
else if (playerInVehicle == false && whichcar != null)
{
//gameObject.GetComponent(Shooting).enabled = false;
cameramain.transform.parent = whichcar.transform;
Char.GetComponent("PlayerMovement").enabled = false;
Char.GetComponent("MouseLook").enabled = false;
playerInVehicle = true;
cameramain.GetComponent(CarCamera).enabled = true;
cameramain.GetComponent(CarCamera).target = whichcar.GetComponent(CarController).centerOfMass.transform;
Char.transform.parent = whichcar.transform;
whichcar.GetComponent(CarController).iminside = true;
//Adam.SetActive(false);
//whichcar.GetComponent(SoundController).enabled = true;
}
Char is set to the current Character Clone.
whichcar is set to the nearest object he tries to enter.
EDIT: I just realized that the character is actually moving with the car, just really really slowly.The Character moves 1 inch in the direction the car is driving when the car moved already 50 meters.
Any ideas?