Hello everyone,
I need help with implementing an interaction system for a first person game. It’s basically like any other major survival game where there is a small dot/cross hair and then if you hover over something you interact with it. ie pick it up, use it, etc. I can’t really find any tutorials so is anybody willing to help me? All I know is that it should use raycasts right?
Place this guy on your character. It will return you the gameobject you hit with the raycast every time you call it. It also has a debug ray so you can make sure everything is in the correct direction for testing.
Oh also, is this supposed to be on the camera or the player? because I have them as 2 seperate game objects, is there anything else I should add because it doesn’t know what _cam is or saveHitPoint variable
you can define _cam using _cam = camera.main
savehitpoint is defined with Vector3 saveHitPoint;
Also, you don’t HAVE to save the position, its will just come in useful later.
You really need to watch some tutorials this is more intermediate level, seems you need to learn the basics.