D
DIYDamian
Guest
Hello. Is it possible to have an object check for collision between two other objects and have that collision affect itself?
The way how I'd use it is simple. I have a camera object that snaps to the player's position based on an 800x608 grid. I want it to pause any movement when the player is colliding with the object objCameraDisabler. As long as the player is colliding with that object, the camera doesn't snap to the player's position.
Here is the code. (This is in the Step Event btw)
I know I'd have to do something in the code below "Change position variables only if player exists" to get the result I'm wanting, but what do I do?
tl;dr: How can I get the camera object to only perform a certain action if the objects player and objCameraDisabler aren't colliding?
The way how I'd use it is simple. I have a camera object that snaps to the player's position based on an 800x608 grid. I want it to pause any movement when the player is colliding with the object objCameraDisabler. As long as the player is colliding with that object, the camera doesn't snap to the player's position.
Here is the code. (This is in the Step Event btw)
Code:
///Move Camera
//Change position variables only if player exists
if (instance_exists(player) == true) {
camToX = player.x
camToY = player.y
}
//Move the camera
view_xview = (((floor(camToX/800)*800)+view_xview)/2)+random_range(-global.camShake, global.camShake);
if (camToY>0 && camToY<=room_height) {
view_yview = (((floor(camToY/608)*608)+view_yview)/2)+random_range(-global.camShake, global.camShake);
}
//Shake Easing
global.camShake = global.camShake * 0.9
tl;dr: How can I get the camera object to only perform a certain action if the objects player and objCameraDisabler aren't colliding?