I have a repositional ball function, which brings the ball to its starting position.
The problem is that the ball is in position, but it differs slightly from its starting point.
Its starting position is (0.0, -0.6, -36.1);
When I shoot, the function starts to function;
The ball appears in its place, but varies in position;
Example (1.3, -1.2, -36.1) ․ and when I shoot, in some cases it tilts, as it appears in its position, but has deviations;
void Start()
{
WinPanel.SetActive(false);
SpawnPos = transform.position;
}
public void RepositionalBall()
{
this.gameObject.SetActive(false);
transform.position = SpawnPos;
this.GetComponent<Animator>().enabled = true;
gameObject.SetActive(true);
StartCoroutine(SetReadyToShoot());
}