DEV Community

Rafael Ahrons
Rafael Ahrons

Posted on

3 1

Devlog #02 - Fixing bugs from pass days and adding Particle System Day 3~4

You can read the original post in my personal blog

Days: 28/01 and 29/01

Bugs fixed

In the last devlog we had an issue with the collision that I couldn't solve. But fortunately we found the answer in Unity API!. The answer was in the rigid body added to Treant.

Colliders on a GameObject that has a Rigidbody are known as dynamic colliders. Static colliders can interact with dynamic colliders but since they don’t have a Rigidbody, they do not move in response to collisions

Particle System

After the bug was fixed we add a particle system to make a blood effect for when the monster or player got a hit it shows up. In the beginning, it won't show in the treant. We had to make a Prefab from the particle system, edit the properties to make small and finally add to the Enemy script.

When we called from the script, it won't show the particles. To fix that bug we use this answer Particle System object (tab Renderer) value of "Sorting Fudge" to -100.

Now we have this:
Player hitting the tree

The code to execute this is simple:

var bloodClone = Instantiate(bloodEffect, 
                             gameObject.transform.position, 
                             gameObject.transform.rotation);

Destroy(bloodClone, bloodClone.GetComponent<ParticleSystem>().main.duration);

Added to Enemy.cs, TakeDamage method. Now every time the object gets hit, it will instantiate a particle system that will be destroyed when it`s over

For the next days, we want to:

  1. Change the scene layout for one that has snow ground and with trees
  2. Add the bonfire
  3. Add idle animations from is a side character
  4. Fix the bug that character can damage enemy hitting from down or up if the enemy is near

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay