View Camra help

Non-platform specific questions.

View Camra help

Postby Turon » Fri May 13, 2011 5:14 pm

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:
Turon
 
Posts: 862
Joined: Sun Jan 24, 2010 5:23 pm
Score: 32 Give a positive score

Re: View Camra help

Postby skydereign » Fri May 13, 2011 10:21 pm

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.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: View Camra help

Postby Turon » Sat May 14, 2011 4:59 am

Is that the none parenting code? :roll:
Turon
 
Posts: 862
Joined: Sun Jan 24, 2010 5:23 pm
Score: 32 Give a positive score

Re: View Camra help

Postby skydereign » Sat May 14, 2011 6:08 am

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.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: View Camra help

Postby Turon » Wed May 25, 2011 1:58 pm

The code did not work that well, can i see a demo of what it should of looked like? :)
Turon
 
Posts: 862
Joined: Sun Jan 24, 2010 5:23 pm
Score: 32 Give a positive score

Re: View Camra help

Postby skydereign » Thu May 26, 2011 6:55 am

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).
Attachments
parentView.ged
(1.26 KiB) Downloaded 71 times
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: View Camra help

Postby Turon » Fri May 27, 2011 6:00 am

Last edited by Turon on Thu Jan 07, 2016 5:29 pm, edited 2 times in total.
Turon
 
Posts: 862
Joined: Sun Jan 24, 2010 5:23 pm
Score: 32 Give a positive score

Re: View Camra help

Postby skydereign » Fri May 27, 2011 7:10 am

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.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest