I’m trying to make an object that launches the player whenever they touch it.
It works fairly well but there’s a very obvious delay whenever the event should be triggered.
The part that triggers the event is the standard gray part in the video.
Here’s the script which is parented under the object in the workspace.
radius.Touched:Connect(function(hit)
if hit:IsA("BasePart") and hit.Name == "HumanoidRootPart" then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
if player then
if player.ActiveValues.BouncepadCooldown.Value == 0 then
local root = player.Character:FindFirstChild("HumanoidRootPart")
local rot = root.Orientation
root.CFrame = radius.CFrame
root.Orientation = rot
--the following lines are unrelated to the issue, but i still felt i should include the entire script
game.ReplicatedStorage.Events.ApplyImpulse:FireClient(player,script.Parent.PrimaryPart.CFrame.upVector*script.Parent.Force.Value)
game.ReplicatedStorage.Events.RemoteAnim:FireClient(player,"rbxassetid://11521605947",nil,0.15,nil,false,Enum.AnimationPriority.Movement,2)
player.ActiveValues.BouncepadCooldown.Value = 1
local goal = {}
goal.Value = 0
local tween = game:GetService("TweenService"):Create(player.ActiveValues.BouncepadCooldown,TweenInfo.new(0.25,Enum.EasingStyle.Linear),goal)
tween:Play()
end
end
end
end)
I apologize for any potential errors in this post, I’m not very familiar with the devforum.