I Think i Fixed Everyting

This commit is contained in:
juliuse98
2021-11-11 20:26:03 +01:00
parent ea8394bd16
commit a31989b459
18 changed files with 2106 additions and 612 deletions

View File

@@ -6,7 +6,7 @@ using Mirror;
public class Shoot : NetworkBehaviour
{
[SerializeField] GameObject muzzle;
[SerializeField] ShootAnimation shootAnim;
[SerializeField] ProcedualAnimationController shootAnim;
[SerializeField] float fireRate;
[SerializeField] GameObject gunHoldPos;
@@ -40,6 +40,9 @@ public class Shoot : NetworkBehaviour
if (Physics.Raycast(muzzle.transform.position, muzzle.transform.forward, out hit))
{
GameObject g = GameObject.CreatePrimitive(PrimitiveType.Sphere);
g.transform.position = hit.point;
g.transform.localScale = new Vector3(0.1f, 0.1f, 0.1f);
if (hit.transform.gameObject.GetComponent<Player>() != null)
{
dedplayer = hit.transform.gameObject;
@@ -53,6 +56,6 @@ public class Shoot : NetworkBehaviour
// This code will be executed on the Client.
void shootAnimation()
{
shootAnim.recoil(gunHoldPos,0.1f);
shootAnim.Recoil(0.1f);
}
}