Search Unity

Question How to make sword line renderer slash or intersection?

Discussion in 'Scripting' started by eitanbariboa, Sep 24, 2022.

  1. eitanbariboa

    eitanbariboa

    Joined:
    Mar 19, 2020
    Posts:
    26
    Hello, i would like to make a sword slash like the gold line shown in the picture but only for 3D gameobjects.
    Screenshot_2022-09-24-08-45-10-176_com.google.android.youtube.jpg
    The issue comes when trying to calculate the vector3 points surrounding the gameobject mesh when the sword pass through and setting them in the linerenderer through script.


    In 2D its simple. Take the first left side point and the last right side of the object and set it in line renderer.


    If someone has an asset or solution to how to make the same thing work but only for 3D models
     

    Attached Files: