Skip to content

Commit

Permalink
fixed a bug with damage bubbles
Browse files Browse the repository at this point in the history
  • Loading branch information
orion3dgames committed May 21, 2024
1 parent c0d746f commit 4bc2b4e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/client/Entities/Entity/EntityUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,23 +152,22 @@ export class EntityUtils {

let text = "" + healthChange;
let color = healthChange > 0 ? Color3.Green().toHexString() : Color3.Yellow().toHexString(); // set current color
let { planeWidth, planeHeight, texture, material } = this.createMaterial(0.3, 1.5, text);
let { planeWidth, planeHeight, texture, material } = this.createMaterial(0.4, 1.5, text);

// create plane
let uuid = generateRandomId(6);
var plane = MeshBuilder.CreatePlane("damageBubble_" + uuid, { width: planeWidth, height: planeHeight, sideOrientation: Mesh.DOUBLESIDE }, this._scene);
plane.position = entity.position.clone();
plane.parent = entity.mesh;
plane.position.y = plane.position.y + this.entity_height;
plane.billboardMode = Mesh.BILLBOARDMODE_ALL;
plane.parent = entity.mesh;
plane.material = material;

// draw text
this.drawDynamicTexture(text, texture, color);

// set meta
plane.metadata = {
end_position: entity.position.y + 5,
end_position: entity.position.y + 6,
material: material,
texture: texture,
offset: randomNumberInRange(-0.002, 0.002),
Expand Down

0 comments on commit 4bc2b4e

Please sign in to comment.