Problem with tweening HumanoidRootPart's CFrame

  1. What do you want to achieve? Keep it simple and clear!
    im making a knockback script for my combat system, and im trying to make it to where the player your punching gets knocked back in the direction your facing
  2. What is the issue? Include screenshots / videos if possible!
    the script work perfectly fine, but when u hit two players at the same time since it tweens the cframe of the hrp it makes it to where there bodies will collide into one area which makes either one of both of them fling
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    i tried tweening the enemies humanoidrootparts position but that made the knockback very buggy and i know i can use a body mover to fix this issue but i rather use tweening since it has a certain effect im trying to go for
				local goal = {}
				goal.CFrame = hrp.CFrame * CFrame.new(0,0,-10)
				local info = TweenInfo.new(0.3,Enum.EasingStyle.Quart,Enum.EasingDirection.Out)
				local tween = tweenservice:Create(enemyHrp,info,goal)
				tween:Play()

You probably meant:

goal.CFrame = hrp.CFrame + hrp.CFrame * Vector3.new(0, 0, -10)

Which slides the goal CFrame along its own Z axis, what you have currently transforms the left hrp.CFrame into the space of CFrame.new(0,0,-10)

that just made the enemyhrp fling in a random direction lol

figured it out my self

just changed the goal from your characters hrp cframe to the enemyhrp

1 Like

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