Laurens Posted July 12, 2010 Share Posted July 12, 2010 Hi, Is it possible to have two seperate entities and parent a third entity to both of these entities? Like so: Parent Parent | | -- Child -- Thanks! Quote Link to comment Share on other sites More sharing options...
Mumbles Posted July 12, 2010 Share Posted July 12, 2010 Directly, I don't think so. Closest I can think of is this: Parent Parent | | -- Child -- --joint-- -- Child -- (and just hide the child on the right) Quote LE Version: 2.50 (Eventually) Link to comment Share on other sites More sharing options...
Shard Posted July 12, 2010 Share Posted July 12, 2010 Hi, Is it possible to have two seperate entities and parent a third entity to both of these entities? Like so: Parent Parent | | -- Child -- Thanks! Can I ask what you would be applying this in? Quote Programmer/Engineer/Student www.reikumar.com 2.6 GHz Intel Core Duo - nVidia GeForce 8600 GT - Windows 7 64-bit - 4 Gigs RAM C++ - Visual Studio Express - Dark GDK - Leadwerks SDK Link to comment Share on other sites More sharing options...
Josh Posted July 12, 2010 Share Posted July 12, 2010 Like the Highlander, there can only be one (parent). Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Laurens Posted July 13, 2010 Author Share Posted July 13, 2010 Was afraid so. Basically I have two independent towers that are connected by a beam (plane with a texture). Now, if either one of the towers is destroyed, so should the beam. I was planning on parenting the beam to both towers and then when either tower is destroyed, FreeEntity would also free the beam. Anyway, guess I'll have to find some other way then Thanks everyone! Quote Link to comment Share on other sites More sharing options...
ArBuZ Posted July 13, 2010 Share Posted July 13, 2010 Maybe SetEntityTarget() will be suitable for this. Also as I remember it automatically handles deleted entities. So if you delete the tower and the beam, GetEntityTarget() of the second tower will return NULL. Quote Q6600@2.4GHz - 9600GT - 4GB DDR2@800MHz - Windows7 x64 3ds max / photoshop CS3 / C++ http://www.arbuznikov.com Link to comment Share on other sites More sharing options...
Laurens Posted July 13, 2010 Author Share Posted July 13, 2010 I have not yet seen this command but if the index parameter means I can store multiple targets than this would indeed solve my problem. I would simply set the target for the beam to both towers and check for NULL through GetEntityTarget each update call. That would be awesome Will try it out as soon as I get home. Thanks! Quote Link to comment Share on other sites More sharing options...
Rick Posted July 13, 2010 Share Posted July 13, 2010 You could make this Beam an object and have a pointer to it in each tower. Then when you create a Beam object assign it the to towers that make the connection. Then when your Tower object is destroyed check if the Beam object it has is null and if not destroy it also. Quote Link to comment Share on other sites More sharing options...
ZioRed Posted July 13, 2010 Share Posted July 13, 2010 Cannot you just set the beam as parent of both towers and free it when the last tower is freed? Quote ?? FRANCESCO CROCETTI ?? http://skaredcreations.com Link to comment Share on other sites More sharing options...
Laurens Posted July 17, 2010 Author Share Posted July 17, 2010 Hi all, I finally went with SetEntityTarget. The constructor of Beam sets the target to both Towers that are passed via parameters. Then, in the Update() method I check GetEntityTarget for NULL. If either is NULL, the Beam frees itself. Thanks for the help all! Cheers! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.