I’m trying to prototype arm movement for sword fencing game and I’m not sure how should I approach the problem.
I’m attaching reference drawing for easier understanding of the mechanic.
Basics of the mechanic:
- Arm consists of 3 joints: Arm, Forearm and Hand (which has a sword).
- In First state only forearm moves, rotating towards mouse location with constant speed
- As player clicks mouse button the Arm joint should rotate over time to match players direction (second state - arm thrust)
- During the Arm rotation the forearm should aim to match the players direction also and now the Hand joint is active and rotates toward mouse
- After finishing movement which means completely straightening the arm, the reverse movement starts in order to reach first state
- Left hand works exactly same way just there are only 2 joints: Arm and Forearm (Hand is still there but never rotates on her own)
I also want to have reaction-based parrying mechanic where the counter-reaction in form of applied force and also slippery or friction based (depending on the hit angle) sword clash occur.
I’ve read about Inverse Kinematics in Unreal as well as physics simulation but informations from documentation did not give me any clear answer.
As I was trying physics constraint component and noticed that simulated objects tend to act inert I got a little bit lost.
When I tried to combine simulation with any rotational movement through interpolation I’ve reached state where I got no idea what actually happens as my arm flies around in random directions.
I didn’t create skeletal rig yet as my game will be orthogonal top down angle and created character with sprites thinking it should be enough but if I’m wrong please tell me.
How should I approach this problem, should I create skeleton for the character? Is it possible to rotate certain joints during physics simulation without glitchy movement?
Sorry if the forum category isn’t exactly right as I wasn’t sure which one should I go for.