Input action didn't work.

Hello
I’m trying to create an actor with whom the player can interact if he’s close. In this case the player
detection works but I can’t interact with the actor and i don’t understand why. Here is a picture of my problem:

Thanks to anyone who can help

Hi!!

Let me guide you in some points.

  • First check that Box component overlaps the player character collision (and check that player collision overlaps with Box collision type)
  • Dont use Cast on overlaps, instead use Other Actor == GetplayerPawn or GetPlayerCharacter
  • When you press Interact button you can use IsOverlappingActor using GetPlayerCharacter instead of Begin Overlap and EndOverlap (and avoids problem if the player start inside Box collision)

I’ve redone my program as you recommended but it’s still not working. It’s strange because I’ve already done this kind of program and it worked very well before.

a) the actor does not take in input. Only your player controller and possessed pawns can get player input by default.

You can set the actor to receive input in it’s details panel (auto receive player input 0) but it is not recommended as it breaks the flow of control.

b) You usually trigger other actor’s actions via your player’s pawn or your controller (usually through a build interaction system with interfaces)

c) I would also suggest moving to the enhanced input system instead of using the old deprecated input system.

1 Like

Add print text “cast fail!” and connect it to failed cast.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.