playMaker

Author Topic: Get variable value from object that collided with me? [SOLVED]  (Read 1230 times)

NewbNinja

  • Playmaker Newbie
  • *
  • Posts: 15
I'm trying to get the damage variable from the bullet that collided with me.  How would I get the bullet.damage variable and give it to my enemy.damagereceived variable?

Thanks in advance x
« Last Edit: May 26, 2022, 01:13:06 AM by NewbNinja »

NewbNinja

  • Playmaker Newbie
  • *
  • Posts: 15
Re: Get variable value from object that collided with me?
« Reply #1 on: May 26, 2022, 01:12:42 AM »
Figured this out myself too.   You pass the GameObject in the trigger event under the setting "Store Collider".   This saves the gameobject and you can use the "Get FSM Int" function to specify the game object you saved.

I called mine collider.  So I did the following:




Hope this helps someone.
-NewbNinja

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7618
    • jinxtergames
Re: Get variable value from object that collided with me? [SOLVED]
« Reply #2 on: May 26, 2022, 10:18:23 AM »
Hi.
Instead of a 'Conditional Expression' you can also use 'Int Compare' .
But this works fine as well :)

NewbNinja

  • Playmaker Newbie
  • *
  • Posts: 15
Re: Get variable value from object that collided with me? [SOLVED]
« Reply #3 on: May 28, 2022, 02:35:45 PM »
Thanks dude.