Edit Camera Position
JoshKahane
Member Posts: 470
Hi
So Im back with a new issue, haha. This time a camera issue. In my game I want my character actor to be constantly moving and at the left side of the camera, but I cant work out how to do this without my actor moving to middle to right side.
So I want to be able to have my actor constantly being tracked on the left side of the camera. How? If you don't know what I mean I'll try explain further, but I would really like some help, thanks.
So Im back with a new issue, haha. This time a camera issue. In my game I want my character actor to be constantly moving and at the left side of the camera, but I cant work out how to do this without my actor moving to middle to right side.
So I want to be able to have my actor constantly being tracked on the left side of the camera. How? If you don't know what I mean I'll try explain further, but I would really like some help, thanks.
Comments
Create an actor that follows the main actor but with an offset, and give it the control camera behavior.
http://gamesalad.com/wiki/how_to_gsc_follow_another_actor
i.e.
Create a game attribute called playerX.
Create an actor with self.Color.Alpha = 0, to make it invisible, and give it 2 behaviors:
- Control Camera
- Constrain Attribute : self.Position.X = game.playerX
Anyway, that makes sense, so I have my main character that the player will see follow an invisible character which controls the camera.
Although, Im just finding it a little hard to understand in practice. So I have done something wrong. When I test it, the actor you see jumps straight to the invisible one. Rather than follows. Do I want it following or chasing? Whats the difference?
The actor you move around always constrains game(global) attributes to its position. Those game attributes will be read by the invisible actor. i.e. Its position will always be a set distance from your player.
Something which could be implemented in a future version of Gamesalad is being able to move the actual camera box within the screen box. This way not having to create in invisible actor etc.