S
SupaTroopaAlpha
Guest
Hi everyone,
Im having trouble restricting my players gun angle. whether he is facing left or right he can aim the gun behind him even though he isn't facing that direction. I would like to restrict oGun to only aiming between 150 and 210 while he is facing left and 30 and 330 while facing right. When he faces left it works perfectly fine. But if he is facing right then object gun aims everywhere but in between angles 30 and 330. I tried switching the order, making negatives, median and means, but nothing works. I am extremely new to programing and using gamemnaker. Any insight will be much appreciated. Thanks!
in oGun's step event :
//This part is working perfectly
if(oPlayer.image_xscale == -1)
{
image_angle = clamp(image_angle,150,210)
}
//This part has the angle of the gun aim everywhere but in between 330 and 30.
if(oPlayer.image_xscale == 1)
{
image_angle = clamp(image_angle,330,30)
}
Im having trouble restricting my players gun angle. whether he is facing left or right he can aim the gun behind him even though he isn't facing that direction. I would like to restrict oGun to only aiming between 150 and 210 while he is facing left and 30 and 330 while facing right. When he faces left it works perfectly fine. But if he is facing right then object gun aims everywhere but in between angles 30 and 330. I tried switching the order, making negatives, median and means, but nothing works. I am extremely new to programing and using gamemnaker. Any insight will be much appreciated. Thanks!
in oGun's step event :
//This part is working perfectly
if(oPlayer.image_xscale == -1)
{
image_angle = clamp(image_angle,150,210)
}
//This part has the angle of the gun aim everywhere but in between 330 and 30.
if(oPlayer.image_xscale == 1)
{
image_angle = clamp(image_angle,330,30)
}