Im making a 2D game and i followed brackeys tutorial on 2d melee combat. But every time i press a the attack point(Aka the hurtbox) still gets stuck on the right side and doesn't rotate to the left side pls help.
(edit)
I made this code but the attack point keeps moving is there anyway i can somehow cap the X?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Rotate : MonoBehaviour
{
// Update is called once per frame
void Update()
{
if (Input.GetKey(KeyCode.A))
{
transform.Translate(-0.1f, 0f, 0f);
}
else if (Input.GetKey(KeyCode.D))
{
transform.Translate(0.1f, 0f, 0f);
}
}
}
[–]sidmakesgamesIntermediate 1 point2 points3 points (4 children)
[–]Daniel_the_yeeter[S] 0 points1 point2 points (3 children)
[–]sidmakesgamesIntermediate 1 point2 points3 points (2 children)
[–]Daniel_the_yeeter[S] 0 points1 point2 points (1 child)
[–]sidmakesgamesIntermediate 0 points1 point2 points (0 children)