Stride Forums Archive

How to know a model has been clicked on?

3 posts, 2210 views, 2015-10-20 to 2015-11-15

Donny_V (Donny V) 2015-10-20 #1

First time game developer but 10 yr plus veteran with application and C# development.

How can you detect when you click on the screen you picked a model?
Is there a sample somewhere?

Sorry for the noob question.

xenux 2015-10-20 #2

Easiest way to do that is to use the physic engine. Have a look at the Raycasting physic sample.

makotech222 (Steve) 2015-11-15 #3

Follow the raycasting sample project. Basically what you do is cast a ray from the mouse point outwards and get the hitresult. From the hitresult, you will know what gameobject the ray collided with.