How do I smooth out camera swapping between a car and a player?

K

Karam Al-Kofahi

Guest
Say there are three objects, an unmanned car, a player, and a manned car

Whenever a player is close enough to the unmanned car and pressed 'e", both instances are deleted and replaced with a manned car, showing the player inside and is now controllable. My only issue currently is that whenever the action is done, the camera swaps over to the other object (either the player or the manned car), and looks very sporadic and poor. Is there a way to smoothen out the camera swap or just eliminate a moving camera between the two completely? I also have the horizontal and vertical border at 100 pixels in a 305x172 pixel room.

Thank you
 

Binsk

Member
Check your view settings in your room. Down at the bottom are boxes labeled "Hsp" and "Vsp". These specify how fast the camera should move. You can adjust this here or with the variables view_hspeed and view_vspeed. If set to -1 it will snap to whatever you are following, otherwise it will limit the speed to the value specified.

Play with this a bit. You could modify the values depending on how far away your target is from the center of the view so the view acts almost like a rubber band, moving faster if the target is getting too far away but moving slowly if it isn't too off center.
 
Top