I am setting up an interaction system that uses interfaces. When i look up tutorials i see lots of tutorials using event begin overlap and end overlap. Why would i use overlap when i would be able use the e key to perform a line trace to interact with actors/objects?
Hey @fontainebrian!
There, in fact, is no reason for this! It’s more of a dealer’s choice situation, however some game styles will prefer some over others. For instance, imagine trying to pick up a ring off of the ground with a line trace in a third-person adventure!
Another thing to think about- a line trace is extremely thin. Using a sphere trace you can widen that up as much as you’d like so you don’t have to be so EXACT.
But really, you can use traces, overlaps, or both. For instance,
On begin overlap: make item glow to show it is something you can interact with.
To interact: point line trace at said item and it turns a different color, with the letter “E” popping up over it to show you can pick it up.
Really these are just ways of communication between actors, just different flavors. No wrong way.
Hope that helps!
For simpler situations where you just walk over pickups to get them, the collide method is preferrable.
For something like Battle Royale like Fortnight or DMZ, or an ARPG where you collect loot very specific loot on the ground with a pointer / cursor, the line trace method is the way to go.
Both are good for different use cases.