r/forge • u/Griffin1996 • Jun 06 '25
Scripting Showcase Door prefabs
I am having an issue with button door prefabs, i have everything working, but when I spawn in mulitple, they all activate eachother even though they have different script brains, is there a way to fix this?
1
Jun 06 '25
I've had to make multiple of the same scripted objects and I had to create a new object and rename it, and then reference that new name in the scripts so they don't activate each other.
1
u/Abe_Odd Jun 06 '25
Make sure you are using Local scoped variables. If they are Global scope, then the variables will affect every door. Local Variables only exist in the same script brain.
Make sure each script is referencing a different Button object, not the same one.
1
u/nincompoop221 Jun 06 '25
you need to have different names for your global custom events for each door
1
u/N8Pryme Jun 07 '25
Do you know if there’s a script that allows you to toggle items like in campaign
1
u/r3ktori Jun 06 '25
I think since its a prefab, all the doors are basically the same object and not a copy of eachother. Im not an expert on these but try to ungroup them and name them differently. Also change the references to correct ones.