The Black Friday Sale is here! Save up to 70% on over 15,000 products, now through November 30!

Tracing Plugin For Static Meshes

Dawid Bujak - Code Plugins - Nov 25, 2022
Not Yet Rated

Trace position of any static mesh and see what it collides with.

  • Supported Platforms
  • Supported Engine Versions
    5.0 - 5.1
  • Download Type
    Engine Plugin
    This product contains a code plugin, complete with pre-built binaries and all its source code that integrates with Unreal Engine, which can be installed to an engine version of your choice then enabled on a per-project basis.

Melee Weapon Damage System (MWDS) a.k.a. Static Mesh Tracing Plugin lets you trace the position of any static mesh as it moves and see what it collides with.

I’ve created it for my Hack and Slash game for white arms, but it can be used for just about any static mesh.


Trailer

Documentation

support: dawid.buj@gmail.com




Features:


  • Simplicity - The melee weapon damage system (MWDS) is realized through the Static Melee Weapon component. It is a subclass of native Static Mesh, with added functionality to trace positions of colliders every frame. This means there is very little overhead, you work with it like with regular static meshes. See quickstart.


  • Per collider precision - you not only know that collision took place, you also know which collider (by name) hit. This allows for unique behaviors. E.g. imagine a two sided spear where each end is infused with different element - fire on one side, ice on the other. In the static mesh editor you name colliders ‘fire’ and ‘ice’ respectively, then during collision you get information which one collided with the enemy so you can apply appropriate elemental damage.


  • Low FPS mode - on low FPS to improve precision, additional in between traces will be added, of course you get full control over it. See trailer.




Quick Start


  • Call Start/StopSweeping in response to your custom animation events, or add MeleeWeaponSwing anim notify to animation. MeleeWeaponSwing takes the skeletal mesh of your actor, and iterates over all child components of type StaticMeleeWeapon and calls Start/StopSweeping on them.


  • Bind event to OnWeaponHit on a StaticMeleeWeapon, when event triggers it gives you Collisions array with detailed description of all collisions that took place.


  • Implement IOnHitByMeleeWeapon interface on any object and override OnHitByMeleeWeapon to react for hits on this actor. Equivalently you can iterate over Collisions array and call your custom method on reported Actors.


  • To change the mesh to another one, just call SetStaticMesh.

Technical Details

Code Modules: GGStateComponentPlugin (Runtime)

Number of Blueprints: 0

Number of Components: 1

Number of C++ Classes: 6

Network Replicated: No

Supported Development Platforms: Should work on all but tested only on Win64

Supported Target: Build Platforms: Should work on all but tested only on Win64

Additional Notes: This is code only plugin, no assets are included.

Documentation: Documentation