Page 1 of 1

Activate/Deactivate object does nothing

Posted: Sat Mar 16, 2019 12:30 pm
by Oceans14
Does anyone have experience getting ActivateObject to work in their scripts? I need to turn on/off objects for different objectives and for some reason it just doesn't work. I've tried to use Kill/RespawnObject and SetProperty to effectively do the same thing, but the way those work is just different enough to make them unsuitable for my needs. I can add a more situational example if it helps, but basically I just need certain objects to "not exist" until triggered by an event... which is like, the textbook use of ActivateObject I'm pretty sure.

Anyway, I'd appreciate any help. Btw, nothing relevant in the error log.

Re: Activate/Deactivate object does nothing

Posted: Sat Mar 16, 2019 2:16 pm
by Marth8880
Have you considered using CreateEntity instead?

Re: Activate/Deactivate object does nothing

Posted: Sat Mar 16, 2019 3:46 pm
by Oceans14
Nope, but that looks very promising. I'll give it a shot!

Re: Activate/Deactivate object does nothing

Posted: Sat Mar 16, 2019 4:26 pm
by Calrissian97
Pretty sure ActivateObject actually just activates the physics system for that object

Re: Activate/Deactivate object does nothing

Posted: Sun Mar 17, 2019 1:45 am
by AnthonyBF2
You can also have the item alive and then use these two functions to essentially kill it:

Code: Select all

SetProperty("object", "IsVisible", 0)
SetProperty("object", "IsCollidable", 0)

Re: Activate/Deactivate object does nothing

Posted: Sun Mar 17, 2019 6:09 pm
by Oceans14
Calrissian97 wrote:Pretty sure ActivateObject actually just activates the physics system for that object
Interesting! I'll have to mess around with this.
AnthonyBF2 wrote:You can also have the item alive and then use these two functions to essentially kill it:

Code: Select all

SetProperty("object", "IsVisible", 0)
SetProperty("object", "IsCollidable", 0)
I considered using IsVisible but I didn't know IsCollidable existed too - that's a game changer. Will definitely try this one as well.

Thank you all for the advice!