• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

3D help(Crosshair checking with an object)

V

Vinicius Alvarenga

Guest
Soooooo I'm making a 3D game inspired in I'M SCARED, and I'm with a problem.
I made a obj called key, and the sprite and the creation of it in the world it's already done, but, I've made a crosshair using draw GUI and I want to take that key when the crosshair is above it maybe pressing the mouse button, but I don't have any idea how to do that.
So, could someone help me?
Thx
 

Attachments

T

trentallain

Guest
Soooooo I'm making a 3D game inspired in I'M SCARED, and I'm with a problem.
I made a obj called key, and the sprite and the creation of it in the world it's already done, but, I've made a crosshair using draw GUI and I want to take that key when the crosshair is above it maybe pressing the mouse button, but I don't have any idea how to do that.
So, could someone help me?
Thx
If your game has vertical camera movement you will have to use some sort of raycasting done from where you are looking with the camera. Otherwise if there isn't any vertical camera movement and you can only look left/right then you can just use collision_line or some similar method.
 
V

Vinicius Alvarenga

Guest
I'm almost sure you are correct, but if the raycasting is the only option to my case I think I'm going to make things simple and take the key by just passing through the key, if anyone has a simpler idea pls leave the comment. Thx
 
Top