Weird Behavior with weld in a grab ability

Basically, I have an ability where the player bashes their head into the enemy, I used welds to achieve the connection between the enemy and ability caster but it has some weird behavior where the player teleports behind the enemy, everything else works like the anims, damage, knockback and stun but the teleport is really bugging me. I get no errors in case your wondering.

What it looks like most of the time:

It should look like the enemy getting put in front of Player 1

The portion of the script that welds them together

	local hum = humanoid
        local Weld = Instance.new("Weld")
			Weld.Part0 = humanoid.Parent.HumanoidRootPart
			Weld.Part1 = enemyHum.Parent.HumanoidRootPart
			Weld.Parent = Weld.Part0
			Weld.C1 = CFrame.new(0,0,3)
			enemyhumrp.Orientation = humRp.Orientation - Vector3.new(0,-180,0)

Ive tried messing with the orientation, which HumanoidRootPart is Part0 and Part 1 and stuff like that. But to no avail. Id appreciate some help!

2 Likes
enemyhumrp.Orientation = humRp.Orientation - Vector3.new(0,-180,0)

maybe

enemyhumrp.CFrame = humRp.CFrame *  CFrame.angles(0,-math.rad(-180),0)

???

ServerScriptService.Abilities.Fighter.HeadBashAbility:73: attempt to call a nil value

This error occurs (the line where your suggestion is)

Im not sure, but I think the cause is that the hitbox script is saying im the enemy and is making me turn 180 degrees too. ill update if fixed

scratch this, i checked using print it always turns the enemy

The character that moves depends on root priority.

The engine will get confused if 2 root parts are welded.

Try changing the root priority of the one being grabbed to a higher number.

3 Likes

THANK YOU SO MUCH! This will help for other abilities. I had no idea root priority existed, i just changed the value to 1 of the person using the ability now its perfect!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.