hello, I’m making a simple mobile platformer. My character is flipping directions correctly but the spawned bullets don’t travel in flipped direction and instead always go on the right side.
Code for flipping my character:
void flip()
{
facR = !facR;
transform.Rotate(0f, 180f, 0f);
}
Shoot script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class shoot : MonoBehaviour
{
public GameObject bullet;
public Transform point;
public void shootB()
{
Instantiate(bullet, point.position, point.rotation);
}
}
bullet instantiate:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class bulletscrp : MonoBehaviour
{
public Rigidbody2D rb;
public float speed;
// Start is called before the first frame update
void Start()
{
rb = GetComponent<Rigidbody2D>();
rb.velocity = new Vector2(speed, rb.velocity.y);
}
}
Inspector window and hierarchy:
Pls help!