I am making a paintball game and have added a splatter effet to my player, but would like to know how to add a splatter effect to the enemies so if they are it once they get a splatter effect and if hit again they die. Ive made the health system, but want to know how to splatter. I have the splatter textures in teh assets already. thanks in advance. PlayCanvas 3D HTML5 Game Engine
@almish_subuk I have created an effect that I think you are talking about. What I did was created a sprite from a sprite sheet for a paintball like splatter. You can run the following project and cycle thru the weapons using mouse scroll or number keys. I think the second blaster or number 2 key has the splatter. I slowed the animation a bit but you could always speed it up and also you can make the same by using any sprite sheet.
i dont really understand how you implemented it into your game. If you dont mind, could you help me with this? I will add you to the project. Also, sorry for the very late reply.
@almish_subuk Hi sorry for the late reply. You don’t have to make me part of your project. I am more than willing to help you in the correct direction. As long as I can fork your project and it is a valid link I can have a look. I will see if I can get you some answers as soon as I can.
oh! thanks. btw, the branch im working on is branch ‘am’
hey, sorry for the late reply but uhh i was going to just change the enemies color on hit. if you can still help me with the splatter effect you had in your game, that would be great, but im figuring out how to change the enemies color. here is the script but i keep getting errors.
Enemy.prototype.splatter = function() {
// make the enemie change color
const colors = {blue: "0000FF", green: "00FF00", red: "FF0000", orange: "FF7400", yellow: "FFFF00"};
var color = pc.math.random(0,4);
var splashcolor;
switch(color) {
case 0:
splashcolor = colors.blue;
break;
case 1:
splashcolor = colors.green;
break;
case 2:
splashcolor = colors.red;
break;
case 3:
splashcolor = colors.orange;
break;
case 4:
splashcolor = colors.yellow;
break;
}
this.entity.model.meshInstance[0].material.diffuse.set(splashcolor);
this.entity.model.meshInstance[0].material.update();
};