I’m working on a battleground-like ability for my game at the moment, however at the end of the animation I have the enemy get kicked away, so I play a rolling animation for the enemy, however there are a few issues I’m having so far.
After the enemy is finished rolling, they sometimes flop over.
The enemy’s rolling animation is very jittery it looks like, I’m not sure if the enemy is colliding with the floor or something else is causing the issue. For the rolling sequence, I’m tweening the enemy’s HumanoidRootPart, maybe that’s the issue?
After the enemy is finished rolling, they do not face the player, which is what I would like them to do.
Video attached is what I currently have, all 3 issues should be present. If something is unclear or explained poorly ask further questions, I will be looking for fixes in the meantime.
local playerLookVector = Player.Character.HumanoidRootPart.CFrame.LookVector
local knockbackDistance = 30
local knockbackDirection = playerLookVector.Unit
local newPosition = HumanoidRootPart.Position + knockbackDirection * knockbackDistance
local Info = TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
local KnockbackTween = TweenService:Create(HumanoidRootPart, Info, {CFrame = CFrame.new(newPosition)})
KnockbackTween:Play()
Another issue with tweening it, if any obstacles are in the way, the enemy will just phase through them. That could be because I have the enemy’s rootpart anchored though.
I was going to say try changing the NetworkOwnership of the HumanoidRootPart on the NPC, but it appears that doesn’t work:
For an NPC in my game, though, setting the Network Ownership to the Client whenever the HumanoidRootPart is unanchored fixed my issues of it falling over.
that might not be the issue with yours, but I also notice when touching that same NPC, it also fixes issues, like collision fixes physics not responding like you’d think they should