I know that AC is not designed for combat. I really want some sort of action/tension in my first person 3d game. Would any of the following be possible without coding?
1} Enemy NPC that chases the enemy that results in death, or punishes player in some way. Maybe dragging player to begining of level. In this scenario, it would be nice if the player could hide, like in a box, so that the enemy NPC would move away.
2} Any form of combat, if not gun, then a punching mechanism? Perhaps the player can chase an enemy NPC. If you are within it's hitbox area and press punch, it will play a death animation and switch into a corpse model/mesh.
If you anyone is aware of the game Baldi's Basic, it has a range of enemy NPCs that serve different functions. And, I'm really open to any kind of action/suspense mechanism and that is why I'm being a little vague.
Like if someone knows how to incorporated something similar but different, I would be very excited to learn how. Thank you ahead of time.
Comments
Welcome to the community, @nixonlee.
In the case of an NPC chasing the Player, you can attach a large Trigger to the NPC that causes them to start chasing the Player once they enter. This can be done with the Character: NPC Follow Action, with an "Exit" Trigger similarly set up to stop following when the Player goes too far away.
If you want to have a line of sight mechanic, swap the On Enter Trigger with a Continuous one, and have it begin with a Physics: Raycast Action between the Player and the NPC's eyes to check there's nothing in between.
To have the NPC perform some attach animation or such when they get too close, you can use another, smaller, Trigger in front of them that plays a Character: Animate Action.
Another technique is to instead use these Triggers to affect Variables attached to the NPC, which a continuously-running "Logic" ActionList then reads. This can be done by adding the "ActionList Starter" component to the NPC and having it run a background ActionList that loops back on itself when complete.
If the Player "dies", you can use the Engine: End game Action to restart the game, or reset the scene.
Player attacks would be a bit more involved as they'd require use of Active Inputs, which allow you to run ActionLists when a specific input is pressed. But, I'd recommend starting with Enemy NPCs first.
A bit of a disclaimer: as you've noted, AC isn't intended for this kind of gameplay so it might take a bit of tweaking to get something that feels decent. Once you've got something though, I'd recommend looking into the use of ActionList assets, and ActionList parameters, so that you can re-use this logic among other NPCs and prefabs.