Download

Adding a non-projectile (melee) attack to default First-Person Gamemode

My needs are fairly simple, but I’ve hit a roadblock in terms of what I can self-teach. I would like, in my first-person game, for clicking the mouse to show an animation of a swinging arm, that interacts with the physics objects in my level and knocks them around. I have the arm mesh, with an animation, and I think I’ve attached it to my character. I also have a very basic blueprint where Mouse1 plays the animation. Having its skeletal mesh under the CapsuleComponent allows me to run around, click, and see the arm animate, but if I look straight down I see the entire mesh, and if I look up, I see nothing, which is not ideal; I’d like for the arm to move with the camera (or ideally, not even be visible until I click).

The other issue I have is actually making the arm contact things – once collision is enabled on it, as soon as I start the level, the arm detaches from the capsule.

I feel like I’m approaching this from entirely the wrong direction, and any guidance would be greatly appreciated. Ultimately, all I want is the ability to slap around the objects in my level to make them move, with the slap targeted at wherever the crosshair is. Those objects already moved around appropriately with the default projectile gun in the first-person template, but I want it to be a slap. There’s no combat or AI to be concerned with, and I don’t care if the objects actually move from the arm contacting it, or from some workaround where the slap animation is cosmetic, but tied to some invisible Add Force action.