Madin 11 Posted November 30, 2016 Instead of hiding and unhiding sub objects, I would like for my Component tower to work by replacing the entire GameObject with a completely different GameObject. Trying to to use the 'ReplaceSelfUpgrade' to replace the defensive structures leads to a crash. What is the best way to have a structure get replaced by another structure once an upgrade (PLAYER or OBJECT) is purchased? Share this post Link to post
Lauren 78 Posted November 30, 2016 It would only crash if you end up with 2 overlapping structures. But in any case it's recommended to go structure -> unit -> structure for pathfinding reasons. Share this post Link to post
Mjjstral 25 Posted November 30, 2016 Try to remove the kind of "IMMOBILE" and test if that works. I've had same problems with my lua object position spawner initially. Share this post Link to post
Madin 11 Posted November 30, 2016 Thanks for the additional information! Share this post Link to post
Madin 11 Posted December 2, 2016 (edited) Crash was because I was using a 'PLAYER' upgrade to trigger the 'ReplaceSelfUpgrade', instead of an 'OBJECT' upgrade. Edited December 2, 2016 by Madin Share this post Link to post