Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
pjenness's avatar
pjenness
Rising Star
9 years ago

Reticle distance

Hi

I currently have a small sphere as a select reticle.

I currently use the ray cast to find a hit, position the reticle there and scale up so that the reticle moves and scales according to what is being looked at.
This in general works well......except it only works on colliders. This is a real problem when there are colliders that dont match the geo 100% or on sprites. It can easily make you go cross eyed when the reticle shoots thru an object that has no colidor (grass, an LOD etc)...or if it hits a collidor that is bigger than the geo its approximating. You end up focusing on something closer or further away than you should.

Is there a way to instead of the ray hitting the collider it hits a textured pixel? So things like the coloured portion of a grass sprite, or geo that doesnt match the collider become the hit point.

How are other people doing this? If you dont use the hit and scale approach and leave the reticle at a close distance you go cross eyed right?

Cheers

-P

2 Replies

Replies have been turned off for this discussion
  • Anonymous's avatar
    Anonymous
    Bit confused about the question and not sure how I can best help since I'm not sure what you've tried. I do not believe there is a way to make the ray hit a texture pixel. You could try:

    - editing the colliders (sizes and positions can be manually toggled)
    - attaching a child game object with a collider attached but removing the mesh renderer so no object appears
    - creating a custom object in Blender/modeling software and attaching a convex collider (could cause performance issues)

    Again tough to provide specific advice without knowing what you've tried. Let me know more and I'd be happy to try and provide some more direction.
  • Its more that intentionally colliders are meant to be more basic than gemoetry, especially for just character capsule colliosn etc.

    However the reticle ray is quite important to be accurate.

    For example if a lamp has no collider, as its up in te air. The ray shoots thru it to a wall behind (or ceiling). I still draw the ball/dot in front of all as its a gui layer. Which means you do notice in stereo/VR that the distance is incorrect.
    Even more so for things like leaves/grass. if you get close to them, they have no colider so the reticle ray goes thru to something behind. YOu naturally focus on the dot so the leaf/grass loses focus.If you focuse o nthe grass/leaf you gomore corss eyed and get 2 reticles due to the extreme distance difference.

    So I need to hit a shaded item, except if it is alpha (grass/leaf cards)

    Cheers
    -P