Hello im working on the shooting part in my game the problem is thhat th bullets are spawning but not moving
Here is my script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Mirror;
public class Shooting : NetworkBehaviour
{
private GameObject Bullet;
private Transform Firepoint;
void Start()
{
Bullet = GetComponent<PlayerControll>().Bullet;
Firepoint = GetComponent<PlayerControll>().Firepoint;
}
[Command]
public void CMDShoot()
{
Shoot();
}
[ClientRpc]
private void Shoot()
{
GameObject _Bullet = Instantiate(Bullet, Firepoint.transform.position, Firepoint.transform.rotation);
_Bullet.GetComponent<Rigidbody2D>().AddForce(_Bullet.transform.forward * 1000);
}
}