2月免费内容现已上架!

Tracing Plugin For Static Meshes

Dawid Bujak - 代码插件 - 2022/11/25

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

  • 支持的平台
  • 支持的引擎版本
    5.0 - 5.1
  • 下载类型
    引擎插件
    此产品包含一款代码插件,含有预编译的二进制文件以及与虚幻引擎集成的所有源代码,能够安装到您选择的引擎版本中,并根据每个项目的需求启动。

Melee Weapon Damage System (MWDS) a.k.a. Static Mesh Tracing Plugin lets you trace the position of any static mesh component as it moves and see what it collides with. But isn't the default in engine collision enough? No it isn't. Non root components (attached to other objects) are never sweeped (traced), this means they do not move 'continuously', but teleport between locations. For this reason they will never trigger 'on hit' (only sweeped can do this) and they will trigger 'on overlap' unreliably (when it happens that component will teleport inside another object and not past it).

This plugin remedies this. Any component can be traced and you get robust collision info on each hit.

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


Explanation Video For Plugin

Trailer

Documentation

Example - Collision detection for boss battle like in Dark Souls

support: dawid.buj@gmail.com








Features


  • Simplicity - The plugin 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.

技术细节

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