Interfaces For Interaction


A demonstration of the two interactable items I made. I used a knife and whole ham objects from a kenney asset pack. At first i just made the two items with strings when you Use them, but I then realized that I would get more points if I gave them more uses. 

For the ham I made it so that it gets "eaten" whenever its used, giving it a float variable that increases each time its used, and getting destroyed once it reaches the maximum number of uses (5 for now). I did notice that the number of uses gets reset each time it gets picked up, which may have been an error on my part by setting the Set Variable node on Event Pickup rather than On Event Begin Play.

For the knife, i thought it'd be funny if I made it so that it killed the shopkeeper if used on it. so I copied the code from the key to the knife, swapping the cast to door with a cast to the shopkeeper, so the shopkeeper blueprint is destroyed instead. I also removed the code that would destroy self, so the player would keep the knife after committing their crime. I don't know why a player would kill the only shop keeper but its there!

Leave a comment

Log in with itch.io to leave a comment.