hello guys i have i have a projectile, when a player spawns it, it is moved by the networkbehavior attached to it
it works on the hostside, the problem is on the client it doesn’t the projectile just travels downwards n not towards the hit.point, lemme show you the codes
[ServerRpc(RequireOwnership = false)]
public void ShowTrailServerRpc(Vector3 startPos, Vector3 hitpoint)
{
StartCoroutine(ShowTrail(startPos, hitpoint));
}
public IEnumerator ShowTrail(Vector3 startPos, Vector3 hitpoint)
{
yield return new WaitUntil(() => startPos != Vector3.zero);
float time = 0;
while (time < 1)
{
transform.position = Vector3.Lerp(startPos, hitpoint, time);
time += Time.deltaTime / trail.time;
yield return null;
}
//hit effect;
}
// I have this code in a networkbehavior attached to a bullet, and is called when the player //spawns it
Do you have netwrok transform on the bullet? It will make the position sync between the client and the server. Or you can create a bullet in the clientRPC and move it localy.