Question about melee.

sneekyo

Member
I'm finding it tricky to set up the custom melee weapons when the weapon model collider actually has to hit the model. Is there a way I can just do a raycast version, where it just hits the center of the screen within a range?
 
What is the problem with the weapon setup? The melee weapon works by checking hits, but you could take a look into the magic item. This might give you what you are looking for.
 
the main problem with the melee weapon is it uses a hit box, and it's really tricky to configure it to hit directly what's in front of the mouse, what I'd love is to have it work more like the half-life crowbar
 
the main problem with the melee weapon is it uses a hit box, and it's really tricky to configure it to hit directly what's in front of the mouse, what I'd love is to have it work more like the half-life crowbar
The hitbox doesn't have to be on the moving item itself. You can position it on the character so it's not animated.

Is there a tutorial for magic items?
 
The hitbox doesn't have to be on the moving item itself. You can position it on the character so it's not animated.
Hi Justin,

Can you give me an example of how I might position it on the character, rather then have it be the collider of the weapon itself as it currently is? It's currently set up how you did the sword, and it's very inconsistent how I did it.
 
You can add a new collider to the child of your character's rig, and then within the First/ThirdPersonMeleePerspectiveProperties you would point to that collider.
 
You can add a new collider to the child of your character's rig, and then within the First/ThirdPersonMeleePerspectiveProperties you would point to that collider.
So say I add the collider, wouldn't it then always be a part of my character, and conflict with movement and what not. Or if I set it as the collider for the melee weapon would it remove it unless equipped?

I appreciate your time!
 
You should set the layer to the SubCharacter layer. This way the collider will not be used for collision detection.
 
You should set the layer to the SubCharacter layer. This way the collider will not be used for collision detection.
Hey Justin, I've done as you instructed however it wont let me set any collider to the hitboxes, except for the one that was part of the original knife model used to create the item.

What am I doing wrong?
 
Hey just checking in about this issue, there is no way for me as far as I can tell to drop a collider into the hit box list, unless it's attached the the original knife used to make the visible item. Am I missing something?
 
You can use object identifiers if you are spawning the object at runtime:


If you aren't setting the item at runtime you can set the collider directly. The body item did this in the version prior to the latest (when everything was switched to runtime items).
 
You can use object identifiers if you are spawning the object at runtime:


If you aren't setting the item at runtime you can set the collider directly. The body item did this in the version prior to the latest (when everything was switched to runtime items).
It is a runtime melee weapon pick up. I've read about the object identifiers from your post, so would I set the object identifier on the collider with the sub character layer, then I'd put an id into there, but how do you then pick that to be your melee weapon hit box collider?
 
I'm sorry Justin, I'm learning bit by bit, I feel bad for asking so many questions, I've always learned a lot from watching your tutorials but when someone tells me bits and pieces I struggle to put them together.
 
but how do you then pick that to be your melee weapon hit box collider?
You place that ID in the collider spot. You leave the collider field blank, select the element, and in the selected element you can specify the ID. In the latest version the Body item does this so it provides a good example.
 
Hi Justin, I've got that working now, however I find that it blocks raycasting from other scripts (that aren't part of opsive interaction) even though it's a subscharacter. Is there any fix for this?
 
You can either adjust the layermask for the raycasts that are causing the problem or change the collider layer.
 
Top