Forum rules - please read before posting.

Using SendMessage with turnOn/Off

I have a script that explodes an object (using the Exploder package) and I want to turn it off at the start Cutscene and then if the player goes thru a trigger I turn it on. I place the explode script inside an Empty GameObject and use .the SendMessage turn Off but it does nothing, as soon as the game starts it explodes.  I tried Object: Visibility : invisible but it also does not prevent the explode script to activate as soon as the scene starts.

How else can I control the turning on/off of a GameObject with a script inside? In general how can I control a script from starting by itself?

Comments

  • edited December 2015
    Have you added Particle switch component to your emitter?
  • The "Turn Off" option is there for conveience - it still requires that the recieving object has a function with the name "TurnOff" to call.

    If your Exploder object has a script with a function to turn it off, you can call it directly using the Object: Call event Action.
  • Thanks again !! I just inserted a TurnOff function in the script and it worked of course. I learned now the real use of the SendMessage, normally used for Turning On/Off actions(cutscenes,triggers,.)


    Incidentally I wanted to know the useage of the Object:CallEvent but it does not exist in your AC Manual

  • Did you try Section 5.2?
  • Of course that's where I looked first. Maybe I am blind but under 5.2 and OBJECT:xxx there is no CallEvent and  searching the whole manual for CallEvent shows nothing.
  • Odd.  And you're using the latest release, v1.49a?
  • I had 1.46 . It is OK but I can't understand how to use it because there is no example
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.