camera problems (PLEAS HELP)

Yal

šŸ§ *penguin noises*
GMC Elder
Move the camera in the End Step event instead of normal Step.
 

Louit

Member
Please post the code you've tried so we can see how you've attempted it and be in a better to help you fix it.
Code:
(STEP)
var _xbord, _ybord, wicam, hecam

_xbord = camera_get_view_border_x(cam)
_ybord = camera_get_view_border_y(cam)
wicam = camera_get_view_width(cam)
hecam = camera_get_view_height(cam)

x += round((xTo - x)/25)
y += round((yTo - y)/25)



if(targ != noone){
if(instance_exists(targ))
{
    xTo = targ.x
    yTo = targ.y
   
   
   

}
} else {
   
   
}

if(wicam != wcam or hecam != hcam)
{
    camera_set_view_size(cam,wcam,hcam)
}

if(_xbord != xbord or _ybord != ybord)
{
    camera_set_view_border(cam,xbord,ybord)
}
 

Nidoking

Member
x += round((xTo - x)/25)
y += round((yTo - y)/25)

if(targ != noone){
if(instance_exists(targ))
{
xTo = targ.x
yTo = targ.y
Why are you setting x and y based on xTo and yTo before you set xTo and yTo based on targ? Surely that should be the other way around.
 

Louit

Member
Why are you setting x and y based on xTo and yTo before you set xTo and yTo based on targ? Surely that should be the other way around.
itā€™s an adaptive camera, if it doesnā€™t have a target it will stop xto and yto will be her x and y returning 0 the value at the end
 

Slyddar

Member
Not exactly sure what you mean by stuttering, but have you tried not rounding the x and y values, as jumping a pixel at a time could be looked at as stuttering, depending on your resolution.
 
Top