Welcome Guest [Log In] [Register]
We hope you enjoy your visit.


You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.

Join our community!

If you are already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Moving child objects; Childs objects are moving delayed to their parant
Topic Started: Nov 22 2010, 06:38 PM (145 Views)
112 in actie
Member Avatar
Member
[ *  * ]
Hello,

I nog have a car with several child-objects. When it's standing still it looks very nice, and the rotation goed also correct, but when my vehicle (parent) is driving my childs move delayed (for 1 step). I have no idea how I can solve it, I have allready tried to change the step-event of the child object to the -end-step event, but that doesn't work...

Here I have a screenshot showing the wheels (and also the bluelights) delayed from the vehicle itself:
Posted Image

Step-event child-object:
Spoiler: click to toggle
Offline Profile Quote Post Goto Top
 
DmitriV
Member Avatar
Advanced Member
[ *  *  * ]
Try just adapt the x,y and z coordinates with GML in the begin-step event.

Probeer gewoon de x,y en z coördinaten over te nemen met GML in het begin-step event. Zoiets als, x = brandweerwagen.x-[een getal] dat getal zul je moeten berekenen met goniometrische verhoudingen. Bijvoorbeeld als de brandweerwagen gedraaid is, dan zul je de exacte x en y verschuiving moeten uitrekenen.
Newbie in U3D...
Offline Profile Quote Post Goto Top
 
112 in actie
Member Avatar
Member
[ *  * ]
I tried it in the begin-step-event, but that isn't working.

For now I'm using the matrix, functions, I have tried it before with the use of sin, cos and tan, but in a 2d space it's no problem, but in a 3d space I just can't get it working, so this matrix/vector calculation is what I use now (and I also think it's the fastes way).
Offline Profile Quote Post Goto Top
 
Despellanion
Member Avatar
Forum God
[ *  *  *  *  *  * ]
All wrong :P

You should control the child objects directly from the main object's step event, like this:
Code:
 

childobject.x=x;
childobject.y=y;

with(childobject)
{
Step();
}

Step();
Offline Profile Quote Post Goto Top
 
112 in actie
Member Avatar
Member
[ *  * ]
It's working, thank you very much :D
Offline Profile Quote Post Goto Top
 
« Previous Topic · Questions about Ultimate 3D · Next Topic »
Add Reply