Jump to content

Make Crosshair Mosue Unity

Spudwell06

I have been building a 3d FPS like game

I am trying to let the player interact with items by pressing "e" when the crosshair/middle of screen is over it

 

Edit:

when the crosshair is over an item, and E is press it sets something off

e.g. interact = True

 

How do i set the crosshair to so it can trigger it

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Hyrogenes said:

I dont exactly understand what you are asking for here.

when the crosshair is over an item, and E is press it sets something off

e.g. interact = True

Link to comment
Share on other sites

Link to post
Share on other sites

20 minutes ago, Spudwell06 said:

when the crosshair is over an item, and E is press it sets something off

e.g. interact = True

I still don't understand if you've asked a question or not. 

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, rickeo said:

I still don't understand if you've asked a question or not. 

How do i set the crosshair to so it can trigger it

Link to comment
Share on other sites

Link to post
Share on other sites

Send a ray cast from your camera that hits a collider on another entity which triggers a script that looks for input to trigger some action.

CPU: Intel i7 - 5820k @ 4.5GHz, Cooler: Corsair H80i, Motherboard: MSI X99S Gaming 7, RAM: Corsair Vengeance LPX 32GB DDR4 2666MHz CL16,

GPU: ASUS GTX 980 Strix, Case: Corsair 900D, PSU: Corsair AX860i 860W, Keyboard: Logitech G19, Mouse: Corsair M95, Storage: Intel 730 Series 480GB SSD, WD 1.5TB Black

Display: BenQ XL2730Z 2560x1440 144Hz

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×