Interact ability when switching camera from Combat to FirstPersonTransformLook

davids

New member
I'm trying to create a scene where the player is sitting in front of a table. I do this by simply switching the main camera to FirstPersonTransformLook and adjusting the Move Target variable. Now my camera is in front of the table, but when I try to interact with objects on the table, nothing works. It seems that the raycast is not working from the center of the camera even though I have marked UseLookPosition and UseLookDirection.

I tested this on a clean scene with Atlas, trying to press a button through FirstPersonTransformLook when the player’s body itself is far away.

Is there something I missed?
 
This does sound like a raycast issue. Different view types have different look positions and directions. For consistent results you'll want to not use the look source for the raycast. If you are using the look source then you'll need to adjust the parameters with the state system.
 
1-what parameters you mean "adjust the parameters with the state system" ?

2-It seems very clear in the demo scene that if you attach the player camera at runtime to an empty object with the FirstPersonTransformLook view type in front of the trigger button, it will only work if the body itself is next to it. But if the player is far away, nothing works. So, it's clear that the ray is cast from the body, not from the center of the camera.

I don't know maybe I missed something?

Example.pngExample.png
 
Last edited:
1-what parameters you mean "adjust the parameters with the state system" ?
I was thinking the cast offset/distance to get both the first and third person variants to line up. This would be done with the state system so it switches at runtime.

2-It seems very clear in the demo scene that if you attach the player camera at runtime to an empty object with the FirstPersonTransformLook view type in front of the trigger button, it will only work if the body itself is next to it. But if the player is far away, nothing works. So, it's clear that the ray is cast from the body, not from the center of the camera.
From your screenshot you are not using the look position or direction so the raycast will be sent from the character's pivot position.
 
Back
Top