playMaker

Author Topic: Help with parenting multiple children of a game object... Endless runner  (Read 957 times)

earlybird

  • Playmaker Newbie
  • *
  • Posts: 2
Hi,
im pretty new to playmaker and im trying to create a simple endless runner generator. im trying to find a way to reset the terrain position so that it doesn't get too far away from the centre of the scene...

currently im detaching the children (terrain segments) then resetting the parent position but i can find a way of re-attaching those children back under the parent??

one plan (which im not sure how to achieve) would be to re-parent all children to another parent, reset the first parent and then re-attach the children back to the original parent...

any help would be grateful, thanks!
« Last Edit: January 29, 2020, 09:57:59 AM by earlybird »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7623
    • jinxtergames
Re: Help with nesting and parenting children of a game object
« Reply #1 on: January 29, 2020, 09:26:25 AM »
Hi.
A way i did this on a old project is have a empty object (call it 'Start Point' for example) then place terrain as a child and move 1 side to the pivot of the empty object (parent)
Then make a empty child and place it at the other end (call it 'End Point' For example.

Now to place a next terrain, get the position of the 'End Point' and Set the 'start point' to that position.

earlybird

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Help with nesting and parenting children of a game object
« Reply #2 on: January 29, 2020, 09:55:11 AM »
Hi
Thanks for your reply, I'm already doing something very similar for stitching the terrain together. My issue is that the terrain will continue to generate in one direction and get further and further from the centre of the scene. So to offset this in planning on detaching the children segments, reseting the parents position to match the players position then reattach the child segments and moving everything back to 0,0,0
« Last Edit: January 31, 2020, 04:02:56 PM by earlybird »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7623
    • jinxtergames
Hi.
i Had a system that uses pooling and detect when player had passed by the terrain, when passed by and near end of the next block , placed it back in to the pool