Jump to content
Madin

Replace structure with another structure?

Recommended Posts

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

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

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

Crash was because I was using a 'PLAYER' upgrade to trigger the 'ReplaceSelfUpgrade', instead of an 'OBJECT' upgrade.

Edited by Madin

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×