Page 1 of 1

View Camra help

PostPosted: Fri May 13, 2011 5:14 pm
by Turon
How do you keep the view still before pressing the play button and have it move after pressing it to follow the player. it has been giving trouble for so long! :P :oops:

Re: View Camra help

PostPosted: Fri May 13, 2011 10:21 pm
by skydereign
Just parent the view to the player when you press the play button. And if you ever want it to stop following, unparent it.
playButton -> Mouse Button Down (left) -> Script Editor
Code: Select all
view.x=player.x-view.width;
ChangeParent("view", "player");


The first line of that is to move the view to the player. Not sure if that is what you want to do, I usually create the player actor when I click the playButton, but it doesn't sound like that is what you wanted.

Re: View Camra help

PostPosted: Sat May 14, 2011 4:59 am
by Turon
Is that the none parenting code? :roll:

Re: View Camra help

PostPosted: Sat May 14, 2011 6:08 am
by skydereign
That code is the parenting code that you asked for. If you notice... ChangeParent does not have "(none)" in it, like the unparenting code would.

Re: View Camra help

PostPosted: Wed May 25, 2011 1:58 pm
by Turon
The code did not work that well, can i see a demo of what it should of looked like? :)

Re: View Camra help

PostPosted: Thu May 26, 2011 6:55 am
by skydereign
Due to some problems with parenting it didn't work quite right, but this demo shows it working fine. Just had to adjust for the relative coordinates. Click the actor to set control to the player, which can move right (press right).

Re: View Camra help

PostPosted: Fri May 27, 2011 6:00 am
by Turon

Re: View Camra help

PostPosted: Fri May 27, 2011 7:10 am
by skydereign
You'll need to give me more than "A new problem!", because frankly put that ged file you sent is full of problems. It would help if you asked something, as there are numerous things that should be fixed, and I don't have time to fix them all. It seems you have three events all meant to do the same thing, two of them are tied to the background for some reason... So... remove those three events, Background -> Keydown (a and space), as well as LoadPlayGame -> Keydown (a). You shouldn't have three events trying to do the same thing, they will conflict with each other.

One of the problems is the background is parented to the view. This causes the background to be at a higher zdepth than the view. So if you parent the view to the player, it has a higher zdepth than the player. This means you won't be able to see the Slimeman actor. The list goes on.