playMaker

Author Topic: Get Owner / Get Parent / Active Game Object - issue ~  (Read 876 times)

san

  • Junior Playmaker
  • **
  • Posts: 93
Get Owner / Get Parent / Active Game Object - issue ~
« on: October 13, 2020, 10:06:07 PM »
Hello all, I'm having a little trouble understanding with Get owner and active game object on/off.

For Example, In Player, I setup empty game object that has Get Owner with Global Variable. (Named it to Global-Empty)
Then I setup the enemy that has trigger event that waiting Player to Enter. So whenever player enter to enemy, Player empty game object is turn on. For that i am using Active Game Object /On with Global variable (Global-Empty) instead of empty game object itself.

But the issue is Get Owner didn't read first when the active game object is turn ON.

So i had a lot of issue with Enemy-Prefab is looking for Player Object with Get Owner/ Global Variable, those are not responding even the game Object is turn ON.

The only way Enemy-Prefab can send global variable to player is... in the scene the game object itself need to Turn ON every-time. When Active Game Object is Turn OFF Global variable didn't read. Even Active Game Object is turn ON the Global variable didn't read at the same time. Seem it skip when I click Play. I alway put Get Owner in first init State then move to another event.


I am not sure if anyone is had or maybe experience this problem ? Maybe i am doing something wrong or maybe i dont know how to use Get owner? Let me know if anyone can explain..?


djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7622
    • jinxtergames
Re: Get Owner / Get Parent / Active Game Object - issue ~
« Reply #1 on: October 14, 2020, 05:29:35 AM »
Hi.
Can you show some images of your setup or a video.

san

  • Junior Playmaker
  • **
  • Posts: 93
Re: Get Owner / Get Parent / Active Game Object - issue ~
« Reply #2 on: October 14, 2020, 11:02:04 PM »
Videos is in lower quality now but still pending to good quality.

So in this video the first enemy that Player enter into yellow ring, supposed to turn on player foot noise game object. But it's not activating the game object even player is inside the trigger Yellow ring. Spawn Foot noise game object is inside player container (Robot Kyle)

On second Enemy when player enter into yellow ring, the trigger event turn on the player foot noise game object. it work because of it is the first enemy-prefab i drag from folder into scene.

The second enemy, the player enter is the first enemy-prefab that i drag from folder into scene. First enemy, player enter is second enemy-prefab (duplicate prefab). You can probably see it lower bottom left, showing Enemy_lvl3_GRP and Enemy_lvl3_GRP 1.




san

  • Junior Playmaker
  • **
  • Posts: 93
Re: Get Owner / Get Parent / Active Game Object - issue ~
« Reply #3 on: October 15, 2020, 01:26:13 AM »
I think i found the issue why this might not working. So in player i am doing Send Event to enemy-prefab with a Global variable (ex, Global Get Owner Enemy)

So that Global variable is sharing with duplicate enemy-prefab. So if i drag enemy prefab from folder to scene multiple time, they all share same global variable. so when player do Send Event, it doesn't know which game object to send ? Am i thinking correct ? let me know if i am wrong...

I think i post this similar issue on previous posted. On previous post i had enemy health problem. so whenever player shoot a bullet, all enemy health in the scene is taking damage cuz of Global variable. So i had to change in Enemy health variable to local. so when bullet hit, it does not share variable with other prefab.

But current problem is different, because Player is Sending Event that is looking for Enemy Get Owner/Global Variable, and that Global variable is sharing other enemy-prefab as well.

So i dont know how other people set up multiple enemy in the scene. Do you guys have 5 or 10 enemy game object with different global variable names?

please help and need advices.