Hello, i make it short… i’ve got 2 problems
Problem 1:
My Character is Flipping right but i cant see the Sprite from the other side… what should i do?
Here is my code:
void Flip ()
{
Vector3 flipScale;
flipScale = rb.transform.localScale;
flipScale.x *= -1;
rb.transform.localScale = flipScale;
facingRight = !facingRight;
}
Problem 2:
I move my Character with the Rigidbody velocity but when i move the character is bobbing little bit around, i’ve tried to solve the problem with FixedUpdate() but it dosen’t change…
Here is my code:
void Start ()
{
source = GetComponent<AudioSource>();
rb = GetComponent<Rigidbody>();
}
void FixedUpdate ()
{
Movement();
}
void Movement ()
{
//Turn Right
if (Input.GetKey(turnRight))
{
rb.velocity = new Vector3(walkSpeed, rb.velocity.y, rb.velocity.z);
if (!isPlayingSound)
StartCoroutine(walkStepsAudio());
if (!facingRight)
Flip();
}
}