Gamestudio Links
Zorro Links
Newest Posts
Parent/child object
by 3run. 09/11/26 06:21
ZorroGPT
by TipmyPip. 09/09/26 14:35
[MED] Import from FBX (2010) missing!!!
by USER0328. 09/03/26 18:03
Purchase A8 full licence version
by ukgamer. 08/30/26 14:27
Retrieve optimize() variables order (edited)
by NorbertSz. 08/25/26 13:24
Max Number of Strategies in /Strategy folder
by Martin_HH. 08/17/26 07:54
Pause button for evaluation shell?
by AndrewAMD. 08/13/26 17:16
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (3run, matty47), 3,715 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
speedx, liop, Bauer097, riggi89, shuhari
19233 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Parent/child object #489619
09/07/26 07:00
09/07/26 07:00
Joined: Oct 2003
Posts: 829
22�21'24"N 114�07'30...
Frederick_Lim Offline OP
User
Frederick_Lim  Offline OP
User

Joined: Oct 2003
Posts: 829
22�21'24"N 114�07'30...
Can't GameStudio add one object to another? For example, can I add object B to A, so that when I move/rotate object A, object B will move/rotate with it?

Re: Parent/child object [Re: Frederick_Lim] #489632
2 hours ago
2 hours ago
Joined: May 2009
Posts: 5,378
Caucasus
3run Online
Senior Expert
3run  Online
Senior Expert

Joined: May 2009
Posts: 5,378
Caucasus
Nope, you'll have to move/rotate it by yourself.

In action function of ENTITY a, you could create ENTITY b as it's parent.
Then in while loop at the very end (after moving ENTITY a) you could check, if ENTITY b exists, and if it does, then move/rotate it with ENTITY a.

Code
action move_test()
{
	my.parent = ent_create(CUBE_MDL, my.x, NULL);

	while(my)
	{
		// move my
		
		if(my.parent)
		{
			vec_set(my.parent.x, my.x);
			vec_set(my.parent.pan, my.pan);
		}
		wait(1);
	}
}


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1