Page 1 of 1

It´s possible to make splatt hit&out body?

PostPosted: Wed Jun 15, 2016 10:44 am
by MasterZuruk
Hi all,

It is very easy to detect the hit of a bullet and spawn a splatt using "on collision with...", but, it is also possible to detect the output of the bullet and generate another splatt?

I'm doing some tests using offset detection:

Image

But I can not get the result I'm looking.
The other problem is that if you need to calculate the trajectory of many bullets at the same time, this can cause too many cpu usage and a direct impact on fps.

Any idea is welcome!
Thanks :D

Re: It´s possible to make splatt hit&out body?

PostPosted: Wed Jun 15, 2016 11:04 am
by SoldjahBoy
You could "cheat" and simply make your projectile do the work for you...

1. Bullet hits enemy/player
--- set bullet invisible
--- set instance variable HasHit to "true"

2. Bullet variable "HasHit" is true AND is not overlapping enemy/player
--- create blood splatter (at angle of bullet)
--- destroy bullet

So basically the bullet doesn't destroy itself until it's gone in AND out again from an enemy, creating a blood splatter on entry AND exit if you want.

I'm sure there's some genius mathematical solution to this - but I'm a creative thinker not a mathematician - so that's probably how I'd do it. The bullet is already travelling at a given angle and velocity, so why not use that data and positioning? Faster bullets could create bigger splatters, or whatever... there's a load of ways to use existing data as random variables :D

~Sol

Re: It´s possible to make splatt hit&out body?

PostPosted: Wed Jun 15, 2016 11:45 am
by MasterZuruk
That was exactly what I was looking for, thank you Sol!

I did a couple of tests without much detail to see how can it looks:

With bullet destroy:

Image

Without destroying the bullet:

Image

It does not look too bad to be a sketch, once again, thank you Sol!

Re: It´s possible to make splatt hit&out body?

PostPosted: Wed Jun 15, 2016 12:59 pm
by SoldjahBoy
No problem mate!

I'm REALLY bad at trying to do stuff the "proper" and "mathmetically genius" way - but I can redneck engineer almost anything to work :D

Hit me up if you get stuck with anything else like this ;)

~Sol