I’m currently working on creating a trampoline similar to the one in the “Amazing Frog” game (please refer to the video below). However, I’m unsure how to implement the player’s ability to move forward, backward, left, and right while floating in the air, just like in the video, after jumping on the trampoline.
Thank you in advance for your answers!
ㄴ Edit: I use LinearVelocity to make the player fly up
My Trampoline (WIP)
Amazing Frog Trampoline - Watch the video after 20 seconds
To include “Movement” try adding Additional Forces like, a VectorForce or BodyVelocity(preferably a VectorForce)
After adding this force (VectorForce) parent it to the HumanoidRootPart, and set attachment0 to RootAttachmet.
Using a VectorForce set RelativeTo to World. Once we’ve set up the VectorForces, we want to move the force according to the humanoid’s MoveDirection, and multiply it by a constant because unlike BodyVelocitys’ they have a MaxForce value; We’ll multiply the Force by a value we’ll just call STRENGTH, you may have to increase or decrease this value to your liking.
NOTE
Use a Local Script to write this code, And put it in StarterCharacterScripts.
The provided code isn’t complete, make sure to get the Character from the player
Concluded Code
-- the code before stays the same...
Local Humanoid = Character:WaitForChild("Humanoid")
Local RunService = game:GetService("RunService")
Local VectorForce = Instance.new("VectorForce")
VectorForce.Parent = Character.PrimaryPart
VectorForce.Attachment0 = Character.PrimaryPart.RootAttachment
VectorForce.RelativeTo = Enum.ActuatorRelativeTo.World
Local STRENGTH = 10
RunService.RenderStepped:Connect(function(delta)
if Humanoid.Health > 0 then
VectorForce.Force = Humanoid.MoveDirection * STRENGTH
end
end
If there is any Problems please respond with the issue!