Posted November 11, 2023 by MelonJoose
Plenty of things have been added since the previous post. I had to trial and error the knockback quite a bit as I attempted to use point effector2D to create a knockback. However, the Particle system was messed up after adding it which it made the particle system play multiple times. I suspect it is due to the collision with the effector that triggers the play multiple times.
My work around it is to set the particle system to play on-awake and set the particle system game object as false. Then proceed to Set it active when bullet collider2D comes into contact with other objects. I also removed the effector2D and ended up using rb.AddForce() and adding force to the ghost.cs . by using referencing the bullet and getting its game object, I can use the position of the bullet object and the ghost object to calculate the direction, hence knocking it backward accordingly.
I will need to touch up and add some features like the scoreboard and bullet sparks at the point of shooting. As well as animations for the game menu and the Pac-Man.
Special thanks to the below creators!