I need help with figuring out how to get a mesh to scale non-uniformly.
I'm trying to implement an beam-based weapon in a 3D game. It'll act like Zarya's particle cannon from Overwatch. Specifically, a beam will extend from the player's weapon towards whatever the player is pointing at. While I can use something like a MeshInstance
to extend to a far distance, I would like the beam to extend to some point until it hits a collision. What would be a good approach to implementing this?
I have looked into using a Raycast
in order to detect the collisions, yet I still need to shorten the mesh. I'm fine with scaling it. However, scaling operations seem to be uniform; scaling the mesh on the Z-axis scales it from the origin. I need the mesh to be scaled in the direction of where the beam weapon is being pointed.