Jump to content
  • 0

Projectiles collision larger sprites


Question

Posted

Hi, i've changed the size of the sprites , when I try to hit a target, if I hit the top of the sprite, it takes no damage but gets crossed. come can i solve?

6 answers to this question

Recommended Posts

  • 2
Posted
2 hours ago, GreatZ said:

Can you show me how pls? thanks in advance

Well, it is what I said before, look in the client code specifically in the entities/projectile.cs file and where the spawn of the projectiles is managed, you will see the code in charge of assigning the animations, you just have to make the property that saves the animation be nullable or empty, and in the assignment of the animation you check if the object is null you do not do it, this is in a general way and what would be less complex, in my case I have the following:

86f4562b9d8ccc9d04848c49cf918d48.png

 

The second check is to avoid that two of the spawns collide in the same skill, in this way you do not completely eliminate the functionality that comes by default of being able to create separate projectile spanws.

b75793c6f9dc72cd0b4818f38b23b589.png

Hahaha this image explains a little better how to choose which spawn should have animation, credits to Arufonsu who also worked with me on this.

  • 0
Posted

You'll have to rewrite projectile logic and collision logic for the engine to recognise hits beyond the tiles that an object currently occupied.

 

It's not something the base engine is currently capable of.

  • 0
Posted

One suggestion that would be the easiest and simplest is to reuse the spawns code, specifically creating invisible spawns.

  • 0
Posted

That sounds like a pretty hacky solution that won't perform very well when scaled up to larger amounts of players and projectiles.

 

Personally I'd invest time into making actual hitbox objects and base collision on those.

  • 0
Posted

I understand your point, but restructuring the entire current hitbox system I see it a bit complex, at least I did not find any viable option so far that I can include in the engine without breaking everything, this solution that they suggested of the invisible spawns was suggested by the same JC in the past to have projectiles with larger collisions that are not pixel perfect since X amount of tiles is taken for each spawn.

  • -1
Posted
28 minutes ago, Blinkuz said:

I understand your point, but restructuring the entire current hitbox system I see it a bit complex, at least I did not find any viable option so far that I can include in the engine without breaking everything, this solution that they suggested of the invisible spawns was suggested by the same JC in the past to have projectiles with larger collisions that are not pixel perfect since X amount of tiles is taken for each spawn.

Can you show me how pls? thanks in advance

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...