Overview video
Demo Project Video
What is it?
In first-person games, you usually interact with the world. You pick stuff up, you press buttons, and so on.
This plugin introduces a simple component to make this happen by using linecasts to look for items that can be interacted with.
You can then implement logic on items or on your pawn by using the following events:
* OnFocusStart
* OnFocusEnd
* OnInteract.
What problem does it solve?
It's a simple way to get first person interactions going with events without having to implement your own.
How does it work?
To set it up, you do this:
- Add the SimpleFirstPersonInteraction component to your first-person pawn
- Implement the interface to the item you want to interact with
The SimpleFirstPersonInteraction component will look for the objects and when you come close enough, it will trigger the following events in the items that implement the interface:
* OnFocusStart: When you are close enough and look at the object
* OnFocusEnd: When you are too far away from the object or stop looking at it
* OnInteract: If you interact with the object, this is triggered manually from the pawn, e.g. by clicking LMB