But i want make a wound on player on the same position/orientation the sword hit, i dont have idea if that is possible or How start hit, but iam using that module for hit detection: Raycast Hitbox 4.01: For all your melee needs!
If anyone already did that or have any idea please tell me.
You would want to get the exact point where the sword hit, so you would want to create a ray from the handle of the sword outwards. (This wont be 100% accurate but it should be close enough that it doesn’t matter)
Once you have the position of the hit you can do it one of two ways:
Weld Method:
Create an attachment at the point where it made contact
Create your SFX block with an attachment
Create a weld to hold the block to the player at the attachment point
Constraint Method:
Create the SFX part
Set the SFX parts position to the hit position
Create Alignment constraints (Position and rotation)
Both methods would work but it just depends as to whether or not you want to use attachments. Just when you make the SFX part make sure it imbeds itself inside the Enemy you hit (Half way in) so that any effects create appear to come from them.
When you set the position or weld make sure you rotate the part to face away from the swords angle. (This just makes it look much nicer, without it you could hit at a angle and the effect would still look flat and basic)
Wound:
Having a effect is nice but if there’s just a effect coming out of nowhere it just takes out of the realism of the game. You can create a small model that makes it look like a cut and put that at the area where the SFX is. I’ve seen so many games without this and its just something that always irritates me, a small thing like that can make games a lot more entertaining.
Roughly how to make the rotation:
You will store the swords CF at contact
From this CF you can get the position and rotation
When you make the SFX block make you can make it look at the swords position.
This means that the effect will then point outwards where the sword made contact.
It is important that you build the SFX block with this in mind so that the effect always points forward.
I think that raycast module iam using already return the hit position, but and the orientation? Also iam making the hitbox on client,so i need send the informations to server create the wound (its just a cut sfx)
Looking at the animations you have, wouldn’t it make sense to stop the animation once it hits a target, otherwise it looks as though the blade goes right through them. You could even play the animation in reverse for a second to make it look as though the blade has sort of bounced off a little on impact.
If the blade goes right through an enemy then making SFX at the single point of impact will look really unrealistic as it has actually gone through them. Hence the need to stop playing a animation once it lands a successful hit
Other than this I think with the help of the APIs you can easily create the effect now.