Physics Raycaster - Selected Object

Hello All,

How do I make my Physiscs Raycaster the object I have clicked on?

If I set ‘First Selected’ to be an object, and then click on another object it does then move to ‘Last Selected’ so I that side of it is working, Just not sure where I need to be telling it…

Thanks,
Russell

2069479--135011--Screen Shot 2015-04-15 at 12.43.06.png

The RaycastHit that you pass into the Physics.Raycast function has that information via the collider property.

Debug.Log("I hit: " + raycastHit.collider.GameObject);

Or are you asking for something else? I get the feeling there’s a slight language barrier.

Ah Thanks but I mean using the Event System functionality.

Think this is what I want, not sure how to implement it yet though :slight_smile: