hey everyone,
I’m currently trying to make an arena slasher game and am trying to implement a mechanic that allows the player to control the movement of their sword by holding down the left mouse button and using the mouse movement to swing the sword around.
I’m new to coding with c# and unity in general but this is what I have so far. it’s not much but it is a start in the right direction. I have no idea if this is the right way to go about it by any means.
public class wepswing : MonoBehaviour
{
void Start()
{
}
void Update()
{
if (Input.GetMouseButtonDown(0))
transform.position = Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, 1.5f));
}
}
any help or sample code to help give me an idea of how to even go about this would be greatly appreciated thanks.