- Home /
Parent and child object have same physics
I have a model of a statue, which I want to have physics, but its XYZ axles are messed up, and I had to use a parent object to make it have the correct axles.
Well, now I have the movement scripts on the parent object, which is a little ball in the center of the statue model, and the collisions in the statue model itself, including the rigidbody.
they move at the same time with the movement scripts I made, but if the moving statue hits a wall, and the parent object does not, they will get separated and it looks very stupid and makes the statue move weirdly.
Here's the code I have now:
#pragma strict
var Child = transform.Find("StatueModel");
function Update () {
transform.position = Vector3(Child.position.x, Child.position.y, Child.position.z);
}
so... what now?
Axles? The word is "axes", which is the plural form of axis.
I'd start by fixing your initial problem rather than trying to work around it. Fix the asset first so you don't have to make systems that are only going to add runtime and programmer-time overhead.
Answer by Deternal · Jun 18, 2013 at 10:07 PM
You have to make active any constraints on child object at rigidbody component. Freeze position and rotation X , Y , Z must active at rigidbody.
Your answer
Follow this Question
Related Questions
Object always falling off moving platform 2 Answers
Object movement impacted by another 1 Answer
Moving object with constant speed 2 Answers
Character getting stuck on walls 2 Answers
How not to make a RigidBody not go into ground when tilted foward? 1 Answer