So I implemented a raycast shooting mechanism in the game by following a tutorial and it does the job, I have damage and health working but whenever I try shooting a sphere, It just flattens out. It does disappear when I shoot it enough times because it’s health decreases but how do I prevent it from flattening out as such?
void Shoot ()
{
RaycastHit hit;
if (Physics.Raycast(fpsCam.transform.position, fpsCam.transform.forward, out hit, range))
{
Debug.Log(hit.transform.name);
I’M sorry but I don’t think anyone can make out any sense of what you just posted ^^. A Sphere doesn’t flatten itself unless you scale it non uniformly in one or two directions only. The code you posted is just a raycast and a debug log of the name you hit. So how are we supposed to help you here?
Please edit your question and add more details, especially what actually happens when you shoot / hit something.
By “shooting a sphere” do you mean you shoot at the sphere (which is an object in the scene) or do you mean the sphere is supposed to represent the bullet?