playMaker

Author Topic: Attach an object as child which moves with the parent.  (Read 5697 times)

CharlesN

  • Playmaker Newbie
  • *
  • Posts: 8
Attach an object as child which moves with the parent.
« on: February 24, 2015, 05:04:59 PM »
Hi Playmakers,

 I'm making a little shopping game. I looking for a way to add object an to a shopping trolley (when in an active zone). So I believe I want to Attach an object as child which moves with the parent.

 I can create an object in the basket spawn point but the object stays in a world position.

 This is my first post, hope you can shed some light. Many Thanks

Charles

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Attach an object as child which moves with the parent.
« Reply #1 on: February 24, 2015, 05:15:44 PM »
You can use the Set Parent action for that. =)
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: Attach an object as child which moves with the parent.
« Reply #2 on: February 24, 2015, 05:57:33 PM »
You can use the Set Parent action for that. =)

On the object you want to be a child?

CharlesN

  • Playmaker Newbie
  • *
  • Posts: 8
Re: Attach an object as child which moves with the parent.
« Reply #3 on: February 25, 2015, 01:01:53 PM »
Thank you Lane, I'll give that a try.

'Coffee'- I have a shopping trolley, which when it run into an area, can add an object into the trolley as a child. The FSM is in the 'area' object

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: Attach an object as child which moves with the parent.
« Reply #4 on: February 25, 2015, 03:59:52 PM »

'Coffee'- I have a shopping trolley, which when it run into an area, can add an object into the trolley as a child. The FSM is in the 'area' object

So you are adding a parenting system to permanently add an item to a trolley? I ask this because I'm trying to get a handle on having parented objects in game. 

CharlesN

  • Playmaker Newbie
  • *
  • Posts: 8
Re: Attach an object as child which moves with the parent.
« Reply #5 on: February 26, 2015, 07:26:55 AM »
Hi CoffeeANDSoda,

 I got the parent system to work last night. So I have 3 objects, the player is the trolley, the 2nd object is the interactive area and the 3rd object the item to go in the trolley.

 The first FSM is in the interactive area, using a key diwn function. It 'creates object' in an empty(spawnpoint) within the trolley (storing the result as global variable) and then 'set parent'. That makes the item stick with the trolley.

 Then I have a 'destory object' (destory global result) FSM on the empty within the trolley. Using a key down function.

Does that make sense, hope this helps

Charles
 

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: Attach an object as child which moves with the parent.
« Reply #6 on: February 26, 2015, 03:20:35 PM »
What version of unity are you using? Because I'm using 4.3.4 with playmaker 1.7.7, and it's been acting funky in the current project.


CharlesN

  • Playmaker Newbie
  • *
  • Posts: 8
Re: Attach an object as child which moves with the parent.
« Reply #7 on: February 26, 2015, 05:34:35 PM »
I believe unity is 4.3 and Playmaker is 1.7.2. What part is acting funky? I'm having a little issue with a basic on enter trigger. That's why I was using a key down function to practice.

 Anyone know the best FSM to use for a player entering a cude? (Very basic but trigger event doesn't seem to work)

Charles

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
Re: Attach an object as child which moves with the parent.
« Reply #8 on: February 26, 2015, 09:58:23 PM »
Funky as in transparent shaders not rendering, and objects not being parented properly.