![]() You can adjust the name and offset to match your animation. In this example, the onKeyframeReached function is called when the animation reaches a keyframe named “MoveHitbox”. Track.KeyframeReached:Connect(onKeyframeReached) Local track = animation:FindFirstChildOfClass("AnimationTrack") connect the onKeyframeReached function to the KeyframeReached event of the animation Hitbox.CFrame = handle.CFrame * CFrame.new(0, 0, -1) set the position of the hitbox to a specific offset from the handle Local hitbox = handle.Hitbox - replace this with the actual name of your hitbox Here’s an example script that moves the hitbox to a specific position when a certain keyframe is reached in the animation: local tool = script.Parent To move the hitbox with an animation, you can use the AnimationTrack object’s KeyframeReached event to detect when the animation reaches a certain point, and then set the position of the hitbox accordingly. Local humanoid = part.Parent:FindFirstChildOfClass("Humanoid") connect the onHit function to the hit event of the hammer's hitbox remove the BodyVelocity after a short delay Local bodyVelocity = Instance.new("BodyVelocity")īodyVelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge) Local humanoid = character:FindFirstChildOfClass("Humanoid") apply a BodyVelocity to the player's character Local flingForce = 1000 - adjust this to change the force of the fling Local hitbox = - replace this with the actual name of your hitbox Here’s an example script that applies a fling effect when the player hits a target with a hammer: local tool = script.Parent To create a fling effect when swinging a hammer, you can use a BodyVelocity or BodyThrust object to apply a force to the player’s character when the hammer hits an object.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |