I
Insanebrio
Guest
Hi everyone. I just need to know if its possible to change ingame the parent of a certain instance. Thanks.
Will this work with the YYC too? Sounds like some rather inefficient stuff...No. A parent is assigned to an object in the IDE and cannot be changed through code for an instance. You can change the object but it will only affect those NEW instances created afterwards, not those that exist currently.
It should, but I've not tested it... Can't say it's something I've ever needed to do, and having to use it would suggest to me that there is some flaw in your game logic.Will this work with the YYC too? Sounds like some rather inefficient stuff...
Carrying on from this. You should take a look at your parent-child relationships and ask if it makes sense. What I mean by this is ask if the child object "Is-A" vs "Has-A" parent object. For example, say you have a ParentEnemyObject. Then you make ChildEnemyObject. Now say, ChildEnemyObject "Is-A" ParentEnemyObject and say, ChildEnemyObject "Has-A" ParentEnemyObject. If "Is-A" makes sense, then you should make ParentEnemyObject the parent. If "Has-A" makes sense then you shouldn't inherit from ParentEnemyObject. You should instead contain an instance of ParentEnemyObject.It should, but I've not tested it... Can't say it's something I've ever needed to do, and having to use it would suggest to me that there is some flaw in your game logic.
with (object_or_all) {
if (insert_condition_or_property_here) {
/* Actions */
}
}