Making FPS Wall Switches?

M

Mad_Squirrel

Guest
Not sure where to post this, but what I am asking about may have a lot to do with programming.
Okay, this is all regarding the 3D, or "d3d", format. Let's say I want to make a wall switch in my first person shooter. You know, like how you interact with switches in DOOM or Wolfenstein 3D. You approach the switch, look right at it, and then press the use key. Has anyone made an attempt in creating this?
 
Last edited by a moderator:

Paskaler

Member
Is your game all on the same "floor", like Wolfenstein3D was. If it is, you can use the collision_line function and have the switch be an object with a collision mask.

If not, I think you're going to need to use raycasting, however, I don't really know how this would be implemented inside of GameMaker
 

Fredrik

Member
You can make a collision object, which is set to always be on the player's position, and make it have a line / arrow as a sprite, which rotates in the players look direction. if that makes sense
 

Yal

šŸ§ *penguin noises*
GMC Elder
It's simple: in the collide event between the switch and the player, check if the use key is being pressed (and potentially if the player is looking at the switch, by using angle_difference)
 
Top