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

How to make character walk on a slope correctly?

Asked by 7 years ago
Edited 7 years ago

I need help with making this script affect the torso of the character, instead of a random part.

What I'm trying to do, is this https://twitter.com/egomoose/status/740277001244774400

This script below does the same, but to a part created by an instance. Help?

Trying to make this script do the same thing as...

01local mouse = game.Players.LocalPlayer:GetMouse()
02local moveModel = game.Players.LocalPlayer.Character;
03-- don't detect the model we're moving
04mouse.TargetFilter = moveModel
05 
06 
07local c = moveModel;
08local hrp = c:WaitForChild("HumanoidRootPart")
09local j = hrp:WaitForChild("Root Hip")
10local orig = j.C0
11 
12function placeAtMouse()
13    -- make sure the mouse is pointing at something
14    if mouse.Target then
15        -- where we cast our ray from (shifted slightly up so the ray will hit the surface we're hovering)
View all 46 lines...

This script down here!!!

01local player = game:GetService("Players").LocalPlayer;
02local character = player.CharacterAdded:wait();
03 
04local torso = character:WaitForChild("HumanoidRootPart");
05 
06function drawray(ray, parent)
07    local part = Instance.new("Part", parent or game.Workspace.CurrentCamera);
08    part.FormFactor = Enum.FormFactor.Custom;
09    part.Material = Enum.Material.Neon;
10    part.Size = Vector3.new(.2, ray.Direction.magnitude, .2);
11    part.CFrame = CFrame.new(ray.Origin + ray.Direction/2, ray.Origin + ray.Direction) * CFrame.Angles(math.pi/2,0,0);
12    part.Anchored = true;
13    part.CanCollide = false;
14    part.BrickColor = BrickColor.new("Bright red");
15    --Instance.new("SpecialMesh", part);
View all 52 lines...

Answer this question