I do not know the issue. But whenever the BP is used it just positions me to somewhere random? Its supposed to be a jump, and holds the player in air while a projectile fires. (A jump kind of effect into the air) I don't know the problem, but I have attached my script to this thread. Please help!
01 | -- Variables |
02 | local UIS = game:GetService( "UserInputService" ) |
03 | local Cam = script:WaitForChild( "CamShake" ) |
04 | local ButtonEvent = script:WaitForChild( "BtnDown" ) |
05 | local plr = game.Players.LocalPlayer |
06 | local Mouse = plr:GetMouse() |
07 | local Debounce = true |
08 | local BtnDown = false |
09 | Player = game.Players.LocalPlayer |
10 | Char = Player.Character |
11 |
12 | --- Functions: |
13 | local Tool = script.Parent |
14 |
15 | Tool.Equipped:Connect( function () |
I used to use BodyPositions to hold the player in place while firing a move. When I tried your properties, they kind of flung me all over the place. I suggest using a combination of BodyPosition and BodyGyro to help stabilize the player.
01 | local BG = Instance.new( "BodyGyro" ) |
02 | BG.MaxTorque = Vector 3. new( math.huge , math.huge , math.huge ) |
03 | BG.P = 8500 |
04 | BG.D = 500 |
05 | BG.Parent = Char.HumanoidRootPart |
06 | BG.CFrame = CFrame.new(Char.HumanoidRootPart.Position, Mouse.Hit.Position) |
07 |
08 | local BP = Instance.new( "BodyPosition" ) |
09 | BP.MaxForce = Vector 3. new( math.huge , math.huge , math.huge ) |
10 | BP.P = 15000 |
11 | BP.D = 1250 |
12 | BP.Position = Char.HumanoidRootPart.Position |
13 | BP.Parent = Char.HumanoidRootPart |
Your issue could be with changing the properties after parenting, which could lead to the BodyPosition's default properties going into play on the physics engine before you set the new ones.
If you have charging or delayed attacks, make sure to update the Gyro's CFrame to the new mouse position every frame.
u didnt rlly explain why u need to use this so i assume you would want to teleport a player somewhere so u can simply make a part where u want to teleport them make it invisible and and can collide of and use this (I EDITED THE ANS)
1 | Char.HumanoidRootPart.CFrame = Char.Head.CFrame + Vector 3. New( 0 , 5 , 0 ) |
this should teleport the player slightly above their head then u can anchor the player or whatever u want to keep it in air the unanchoore the player to get it back down