
[ad_1]
In the primary scene(grass scene), the participant works nice within the grass scene, however inside the home, the participant after any enter the participant strikes again a bit.
https://i.imgur.com/aHXwCR7.mp4
my participant motion script is beneath.
utilizing System.Collections;
utilizing System.Collections.Generic;
utilizing UnityEngine;
public class playeMovement : MonoBehaviour
{
//public Animator animator;
public float transferSpeed = 5f;
public Rigidbody2D rb;
public Animator animator;
Vector2 motion;
public static playeMovement occasion;
public string areaTransitionName;
public void Awake()
{
if(occasion == null)
{
}
else
{
Destroy(gameObject);
}
occasion = this;
DontDestroyOnLoad(gameObject);
}
public void Update()
{
motion.x = Input.GetAxisRaw("Horizontal");
motion.y = Input.GetAxisRaw("Vertical");
animator.SetFloat("Horizontal", motion.x);
animator.SetFloat("Vertical", motion.y);
animator.SetFloat("Speed", motion.sqrMagnitude);
}
personal void MountedUpdate()
{
rb.MovePosition(rb.place + motion * transferSpeed * Time.fixedDeltaTime);
}
}
[ad_2]