Legacy GM How to move view?

T

Tonydaderp

Guest
Guys. I am a dumbass. I have tried for thirty minutes and looked at docs.yoyogames.com, but I just cant figure out how to move the view. I want the view_yview[0] to be shifted up by 42 pixels, but saying
Code:
view_yview[0] -=42;
does not work. Is there an obvious function that I have never heard of before? Plz help....
 
That code is correct. Make sure you're using views to begin with though (check in the room editor), and know that views won't let the camera's view leave the room.
 
I just did. Go read the manual or watch some youtube tutorials (Shaun Spalding has a good one on views) if you don't understand these basics. A few hours of studying now is going to save you a hundred hours of headaches later.
 
T

Tonydaderp

Guest
I just did. Go read the manual or watch some youtube tutorials (Shaun Spalding has a good one on views) if you don't understand these basics. A few hours of studying now is going to save you a hundred hours of headaches later.
Actually, my code is in the collision event. Is this a steps problem?
 
Yeah, you really need to go study. This is stuff the most basic tutorials will cover. GM has built in tutorials, too. Step event fires off every frame. Collision events fire off on frames where collisions are occuring. Good luck to you. =)
 

rIKmAN

Member
If it's in a collision event the view will move up by 42 pixels every time a collision happens - is that intended behaviour?

I second the comment to work through some of the basic tutorials and follow some YouTube videos etc, it will save you a lot of time and frustration in the long run.
 
T

Tonydaderp

Guest
If it's in a collision event the view will move up by 42 pixels every time a collision happens - is that intended behaviour?

I second the comment to work through some of the basic tutorials and follow some YouTube videos etc, it will save you a lot of time and frustration in the long run.
Yes it is.
 
A

ajan-ko

Guest
Check your map, is your view following object? If yes, then make it not follow anyone. If you follow some object, it won't move.
 
O

Old_Bean

Guest
In the room editor under the views tab, make sure that "use views" is ticked and that view 0 is enabled from start.

Try adding the code to a keyboard event to see if it's a problem with your view, or with the collision.
 
T

Tonydaderp

Guest
Check your map, is your view following object? If yes, then make it not follow anyone. If you follow some object, it won't move.
Ohhhhhh thank you! I deactivated the view right when the player touches the transition object! Thank you!
 
Top