Greetings,
new unity developer speaking 
I have a small problem with my raycasts…
At runtime the user aims at for example a wall and i want to instantiate an object like a powerup directly next to the object the user hit.
How can i get the direction from where the user hit the object? Like if i have to go into the x,y or z direction with my new object to instantiate it in the correct position.
Most likely a minor issue for most of you, but i cant get my head around all these angles and values the raycast hit returns.
xen
A hit should return the surface normal of the object. Surface normals show the direction that the face is oriented, but are scaled in such a way that their value is between -1 and 1. Check out the RayCastHit object in the reference, it contains most everything you need to interact with a proper raycast. (Just make certain you aren’t initializing them every single grame, re-use the same pointer as much as you can.
Thanks a bunch
thats exactly what i was looking for
To be perfectly honest, raycasts and collision detection are my worst subject in programming… This is the simplest it gets, complex collision detection can really mess with your head.