Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do I smoothly move the player, while keeping the angle based on an object?

Asked by
chaapz 6
1 year ago
Edited 1 year ago

Specifically, I'm trying to make a versatile wall climbing script. I cannot for the life of me apply force to the player. Nothing works. I can't even move the player. Just. How do I easily and smoothly move the player, while keeping the player at a certain angle? Anything helps.

Applying force takes PRIORITY.

EDIT: I don't care about anything other than force anymore. JUST TELL ME HOW TO APPLY FORCE, PLEASE!!

0
So you're trying to move a player while looking at an object? T3_MasterGamer 2189 — 1y
0
T3_MasterGamer, basically. I want the player's orientation to STAY looking at the wall, no matter how much they've moved around. Applying force is the main problem, though. chaapz 6 — 1y

1 answer

Log in to vote
0
Answered by 1 year ago
Edited 1 year ago

Well, this isn't directly helping, nor is it a real solution. There's no force involved either, since I suck at that kind of stuff.

CFrame can be used lots of different ways. One of them being CFrame.new(position1,position2). position2 is the object the player looks at, while position1 is whatever the cframe position is.

A good way to use this would be:

local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local Root = character:WaitForChild("HumanoidRootPart")

game:GetService("RunService").RenderStepped:Connect(function()
    Root.CFrame = CFrame.new(Root.Position,workspace.LookAtPart.Position)
end)

The code above is in a LocalScript in StarterGui!

Hope this helps!

EDIT: This is actually too fun to mess around with!

1
Since it doesn't move the player smoothly I can't use it, but this DID help me with understanding CFrames, so thanks for that. chaapz 6 — 1y
Ad

Answer this question