Press and Hold interactions for player
Hey everyone, back again for our weekly look at Hopeless Forager's development.
The interesting thing I came across and wanted to share this week, was actually a code that eluded me for a bit. I wanted to add a new interactable object that would need the player to press and hold the interact key in order to fully work (basically, I wanted to create a "repair section" object that the player would have to continuously hold down E for a set period of time to fix).
As I'm not fully knowledgeable with Unity's input system, I had some trouble figuring out the best way to approach this, especially since I wanted to limit the player's other inputs when doing this "fixing" interaction.
The solution I found was to separate the Player's usual input commands from the interaction command, allowing me to disable general functionalities while keeping track of the held down interaction command to see when it starts or is cancelled.
Anyway, that's all for today, tchau, everyone!
Victor.
Hopeless Forager
Can you survive the next ejection?
Status | In development |
Authors | arcane-ground games, TheOwl724, Lusenio Incidium |
Genre | Survival |
Tags | Action-Adventure, Horror, Singleplayer, Space |
More posts
- How do you make a computer within a computer game?Mar 01, 2024
- Issues when moving the ship between scenesMar 01, 2024
- How to handle itemsFeb 24, 2024
- The Audio SystemFeb 17, 2024
- AI perception system reworkFeb 17, 2024
- Item system revamp and the struggles that came with itFeb 02, 2024
- Item Transfer Update and ExpansionFeb 02, 2024
- Issues with interaction raycast and player model offsetJan 27, 2024
- Problems with carrying items from scene to sceneJan 27, 2024
Leave a comment
Log in with itch.io to leave a comment.