Page 1 of 1

how can I change view's parent based on a event?

PostPosted: Sun Dec 25, 2011 6:54 am
by raminkhan
Okay I got a character which it hits a ball on the screen after that the ball starts rolling so how can I have the view to change parent and follow the ball from that point on?

Re: how can I change view's parent based on a event?

PostPosted: Sun Dec 25, 2011 9:08 am
by skydereign
In the collision event, you use ChangeParent. By the sounds of it, the player has the collision event with the ball, in which case you can use this.
player -> Collision with ball -> Script Editor
Code: Select all
ChangeParent("view", "Collide Actor");

You can use "Collide Actor" to specify the actor causing the collision event, but only in collision events. If that isn't the event you want, then you may need to do something else, but essentially you just use some form of ChangeParent.