playMaker

Author Topic: OnTriggerEnter, set other game object active false  (Read 1190 times)

Bailie

  • Playmaker Newbie
  • *
  • Posts: 3
    • View Profile
OnTriggerEnter, set other game object active false
« on: May 05, 2018, 08:52:58 PM »
This is what I want to do:
   void OnTriggerEnter(Collider other) {
      if (other.gameObject.CompareTag ("crap")) {
         other.gameObject.SetActive (false);

I can get ontriggerenter to set the other as a temp gameobject variable. I can clear it so it loops correctly. I can get the if statement part. But the Set Property action doesn't work with variable gameobjects, only gameobjects in your scene.

What can I do?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 6398
    • View Profile
    • jinxtergames
Re: OnTriggerEnter, set other game object active false
« Reply #1 on: May 16, 2018, 04:57:26 PM »
Hi.
Sorry for the late reply (i must have overlooked this thread)

You can use 'activate game object' to activate/deactivate the object.

You should avoid using Get/Set property actions, the are mend to be use with 3rd party asset/scripts which do not have playmaker actions.

You can find many custom actions on the Ecosystem
Ecosystem might not work at the moment
here are direct Github Links to the custom actions :
https://github.com/PlayMakerEcosystem
https://github.com/jeanfabre


Join the PlayMaker Discord Channel!