Line trace to change material then revert back

Hello!

  1. Create SightInteraction_Interface add SightState_Function in it with Bool input variable IsPlayerLookingAtMe?

  1. Create SightReaction_BP add StaticMesh_Component and in ClassDetails implement SightInteraction_Interface. Now implement SightState_Event to drive Material of your StaticMesh_Component.

  1. In FirstPersonCharacter_BP implement TraceByChannel to check what Actor you see currently You need DefaultSightActor and NewSightActor variables. Set your Trace distance factor. Now call SightState_Event alternating bool IsPlayerLookingAtMe? to change Material (actually do any things)

  1. You can check if Actor does implement interface before send InterfaceMessage at all… and check if IsValid? and etc…
    GLHF