0
$\begingroup$

This question already has an answer here:

I have a cube (cube.1) parented to another cube (cube.2), and both cubes are dynamic bodies with the same properties. Both cubes have "box" collision bounds. Also, both cubes are inside a room. enter image description here

When I move cube.2 while in the game engine, it collides with the walls of the room and stops. enter image description here enter image description here

But cube.1, which is parented to it, does not. Why is this happening? Also, what can I do to make cube.1 collide with objects and stop moving (stop going beyond their faces)?

$\endgroup$

marked as duplicate by Scalia, David Aug 19 '15 at 23:35

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3
$\begingroup$

When you parent an object to another you implicitly declare the child to be a static object regardless if you set the physics type to dynamic.

If you look at the behavior you say: "I do not want this object to be controlled by the physics. I want it to follow the parent."

Therefore the physics will ignore this object.

From you question I guess you assume that the parent object considers the child. But why should it? If you want to "extend" the object you need to enable Physics/Collision Bounds/Compound on both the parent and the child. enter image description here

If you need the parenting in-game see EjayACER's response. It describes how to do that with the parent actuator.

$\endgroup$
1
$\begingroup$

:D TADAA !! just follow the game logic below. enter image description here

$\endgroup$
  • $\begingroup$ Unfortunately, that isn't working for me. I am still facing the problem highlighted in the question. $\endgroup$ – Droidge Aug 19 '15 at 1:27
1
$\begingroup$

I think you shall have a look at "constraints" or maybe stop dynamics or stop parent in the actuator list whenever it collides with a wall (property or material collision detection)

It depends on the expected "effect". If you could be more precise so could I.

$\endgroup$
  • $\begingroup$ I want cube.1 to get blocked by objects using physics, like how cube.2 gets stopped in the way with objects. "Stop dynamics" and "Stop parent" are not working for me. How would "constraints" work? $\endgroup$ – Droidge Aug 19 '15 at 1:36
  • $\begingroup$ The thing is that as long as your cube1is parented to your cube2 it will do whatever move cube2 does; regardless of physics issues it may encounter. I just gave it a try and it work for me when i do collision actuator remove parent on the cube1 $\endgroup$ – guiz974 Aug 19 '15 at 20:33
  • $\begingroup$ I have on cube1 a collision sensor no trueleveltrig nor anything else. It is looking for a specific property I've called Pute. It is linked to an and controller and a remove parent actuator. My wall got the Pute property and it's a rigid body (but it could be something else). My cube1is parented to cube2 and cube2 got an always sensor connected to a motion actuator. Whenever cube1hit Wall; it falls down on the ground. Cube1 is dynamic like cube2 $\endgroup$ – guiz974 Aug 19 '15 at 20:41

Not the answer you're looking for? Browse other questions tagged or ask your own question.