Check the Button mesh collision in the static mesh editor. See if it got misaligned.
Misaligned collision…
My approach for interactives is to add a collision component and apply custom collisions (object/preset).
In your BP_Button_Door
class add a box collision component. Make it a child of the Button mesh.
- Scale it (Box extent) to match the mesh. Set the collision settings.
- Disable collision on the Button mesh itself.
- Update the hit logic to work with the new collision component.
Technically you should be using a custom collision preset for interaction. You will still use Visibility
channel for traces, but you’ll gain a branch condition to check against.
For interaction I use a custom Object Channel
and Preset
.
The Preset Name is what will be used on a trace result branch.
If you’re using BP Interfaces to Communicate/Interact…
In my projects I use a Capsule component (collision) extended out from the camera as a probe. Its job is to toggle interactive text/widgets on interactive actors that are in focus. I find it more performant than constant traces.
Probe Interaction… Successful overlap call Interface event on overlapped actor.
For the Interact Action I use an input key which fires a trace from the camera.
All interaction logic is coded in an Actor Component.
My interact trace is called on client and then on server.
Note the Then 0
section of the trace. I’m using Base Aim Rotation
and Camera Manager, Camera Location
. Also using a Switch has authority node to set the Servers Trace color.
Clients trace is Red and servers is Purple.
Without using Camera Manager for camera location you get the following trace results.
Camera “Component” Location isn’t updated on the servers proxy of the character. This applies to simulated proxies as well.
With Camera Manager and Base Aim Rotation you get almost a perfect mirror in world location hit. It’s always going to be a little off due to floating point precision errors.
Hope this is helpful. Happing coding.