playMaker

Author Topic: prefab and getting the component of a child [Solved]  (Read 723 times)

colpolstudios

  • Sr. Member
  • ****
  • Posts: 370
prefab and getting the component of a child [Solved]
« on: June 05, 2021, 09:14:53 AM »
My setup is an empty gameobject "Ball holder"

Under this is the "Ball" it's a sprite and under this are the two trails but with different colours. 

I need to set the property of these trails to active or de-active and switch the sprite to a different one, but I can't figure out how to do this. Possibly someone would be kind enough to help?

Thank you for your time

 
« Last Edit: June 06, 2021, 03:49:13 PM by colpolstudios »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: prefab and getting the component of a child
« Reply #1 on: June 06, 2021, 08:36:32 AM »
on the ball holder you can set some gameobject variables which can hold the ball and the trail objects.

Then, it depends a bit on what you have to do.

you could setup a change sprite on the ball holder and you can trigger it by sending a event to it.

you could set fsms on the trails and ball itself and do the behaviors there (and trigger then by sending events to it)

you could also get the objects variables from the ball holder and do the behaviors somewhere else.

colpolstudios

  • Sr. Member
  • ****
  • Posts: 370
Re: prefab and getting the component of a child [Solved]
« Reply #2 on: June 06, 2021, 03:48:41 PM »
Thank you