Ray Based Selection System

Here is a little demo I made this morning trying to get better at python and programming

move mouse to select target

target reticle object moves to target if your highlighting it,

press space if highlighting to add a object using python

press q to add a object using logic

I will comment it out tonight

Attachments

SelectorDetectorMoverGroover.blend (664 KB)

Hey this is really cool, I need something like this for my project and I was wondering how I was gonna do it. I only need the highlight target part, which I assume ray casts from the camera or an empty near the camera to get the object in the center of the view port. Anyway thanks for the resource.

Hey Blueprint, nice job! You’re getting better;) But one thing I would suggest is to use better names for your variables. For example, give your variables names that tell you, or rather tell someone else, what it is (instead of using X, Xa, X2, you could use ‘hitObject’, ‘hitPosition’, ‘hitObjectPosition’). Hope that helps and good luck with your future endeavors:).

I had used the actual values like target.worldPosition, but could not see my ray,
so I hacked in the Xa x2 etc/

but the problem was the ray was in perfect alignment with the center of the screen so you could not see it :smiley: