Interactable - how to require the cursor be on the object?

Here's a video capturing it.

The flower is interactable and when you're in the collider, you can click to "pick" it. However, I need to have it so the player must focus on it with their cursor. Note how in the video I turn around so I'm not even facing the flower, then "pick" it.

This is a common aspect to first person games and I'm sure it's simple with Opsive. I imagine it has to do with CharacterCast or Raycasting or such, but I'm not sure exactly how to configure it in Opsive.

I'd appreciate any advice you have!

Thank you
 
I changed the detection to raycast, but it's not quite right. The flower has a large box collider around it, but as you can see in this video, the interact prompt doesn't show up over the entire box collider. In the video, the focus is above the bottom leaves of the flower before the interact message appears, but you can see in the scene that the box collider goes well beyond the bottom leaves. At other times, the interact prompt appears when the focus is well above where the box collider is.

What else needs adjustment? I'm missing something.
 
I think I managed to fix it by adjusting the cast offset to: x=0, y=1.5, z=0. Formerly it was 0,1,0.

I would expect the raycast to go through the center of the main camera view. Perhaps it's actually starting from where this Vector3 specifies? I'd prefer the former -- is that possible? If not, and the Vector3 must be set manually, how will it be affected by things like crouching? Wouldn't it be wrong then, since the height of the character has changed?
 
The source of the raycast is relative to the character transform itself, not the viewport. So any changes to the character's transform should be accounted for, e.g. crouching.
 
The source of the raycast is relative to the character transform itself, not the viewport
Is this still true with the latest version of UCC? The Interact ability has "Use Look Position" and "Use Look Direction" properties. When I check both and zero out the Cast Offset, I get the desired behavior (precise interaction with object based on a raycast).
 
Using the Look Position/Direction will use the look source (camera) instead of the character.
 
What is the best way to set this up to only allow the ability/prompt for interact for a very small object eg. a small push button?

I'm trying to get this as accurate as possible but struggling a little:

If I ONLY set the 'ObjectDetection' to Raycast it doesn't work at all, only if I also have CharacterCast set as well, is that right?

It then seems as though it's detecting the non trigger collider of the button (which is fine) but detects when I am looking near the button but still too far away, not accurate to JUST the button, what would best achieve this?
 
Currently cast distance =1 and cast offset is default 0,1,0 don't know if that makes a difference.

I just want the prompt to only show when exactly aiming at the button
 
Does the Debug.DrawRay line from the post you linked not work for you in third person? I just tested it with Raycast object detection mode in third person and it seems fine.
 
Thanks @Andrew that really helps to see where it is and what changing the settings does!

Played around with it a bit and getting a much closer to desired result cheers.
 
Top