Jump to content

Recommended Posts

Posted

Quick question:

 

How do I make a static object appear and disappear using an activator?

 

Any help would be very much appreciated, thanks.

Posted (edited)

By attaching a script the static reference in the render window, and having an activator call disable/enable on it.

 

Put this script on the static reference:

Scriptname StaticEnableStateScript extends Objectrefence
 
Activator property myActivator auto
 
AUTO STATE DisablePhase
Event OnActivate(Objectrefence akActionRef)
 
      if akActionRef == myActivator
          self.Disable()
          gotoState("EnablePhase")
      endif
EndEvent
ENDSTATE
 
STATE EnablePhase
Event OnActivate(Objectrefence akActionRef)
 
      if akActionRef == myActivator
          self.Enable()
          gotoState("DisablePhase")
      endif
EndEvent
ENDSTATE
Edited by Terra Nova
Posted

The Script keeps failing, I copied it to the letter.

 

It says "cannot compare a objectreference to a activator" on lines 8,15 and 17,15 which in my case are:

 

if akActionRef == THESilverPlatter01Activator

 

What do I do?

Posted

There's already a script in the CK that can toggle objects on and off. I've used it with lights, candles, water, and sounds before. it's called defaultactivatetogglelinkedref. You add that script to your activator and then in the Linked Ref tab, you choose the object you're turning and off.

Posted (edited)

That works thanks, though I can't seem to link more than one object, I'm planning on linking lots objects.

 

Solved it, I linked the activator to an XMarker and then made that the Parent of the objects I want to toggle.

Edited by TanisDuncan
Posted

Glad to help.

 

Edited to say: That's what happens when I'm typing out slowly on my phone. I'm mapping out a solution without noticing you already worked it out yourself. :laugh:

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...