private void JumpAtPlayer(CChicken chicken, CCSPlayerController player) { var direction…
- User
private void JumpAtPlayer(CChicken chicken, CCSPlayerController player) { var direction = Vector3.Normalize(player.PlayerPawn.Value!.AbsOrigin!.ToVector3() - chicken.AbsOrigin!.ToVector3()); var jumpVelocity = new Vector(direction.X, direction.Y, 300.0f);
chicken.Teleport(new Vector(chicken.AbsOrigin.X, chicken.AbsOrigin.Y, chicken.AbsOrigin.Z + 20), velocity: jumpVelocity);} у меня есть позиция игрока, позиция курицы, мне нужно чтобы курица прыгнула в мою сторону
- Assistant
You want the chicken to jump towards the player's position. Your current implementation already calculates the direction from the chicken to the player and applies a vertical velocity to make the chicken jump. However, depending on how your game physics is set up, you might need to adjust the jump velocity to ensure the jump has the desired distance and height.