Hello, I am using @EgoMoose’s Wall Stick Controller System to move the player when they are on another moving part. I want to remove the Wall Stick part or it, NOT the part where you stick to a moving part, but were you stick to a wall. Does anyone know how to do this? Here is the Roblox Place By @EgoMoose: https://www.roblox.com/games/4631060850/Wall-stick-controller-new-camera
It seems like a little overkill to use EgoMoose’s Wall Stick Controller just for the player to move with the things they stand on
--Phoenixwhitefire 17/02/2022
local RunService = game:GetService("RunService")
local Character = script.Parent
local HumanoidRootPart = Character.HumanoidRootPart
local RayInfo = RaycastParams.new()
RayInfo.FilterType = Enum.RaycastFilterType.Blacklist
RayInfo.FilterDescendantsInstances = {Character}
local Down = Vector3.new(0, -3, 0)
local StandingOn
local LastCF
local function UpdateCF()
local Hit = workspace:Raycast(HumanoidRootPart.Position, Down, RayInfo)
if Hit then
if not Hit.Instance:IsA("Terrain") then
StandingOn = Hit.Instance
LastCF = StandingOn.CFrame
end
else
StandingOn = nil
LastCF = nil
end
end
RunService.Stepped:Connect(function()
UpdateCF()
RunService.Stepped:Wait()
if StandingOn then
local Relative = StandingOn.CFrame * LastCF:Inverse()
HumanoidRootPart.CFrame = Relative * HumanoidRootPart.CFrame
end
end)
As @Judgy_Oreo said, why?
Are you moving them on a platform or a vehicle?
Is the item moved by CFraming or is it a Constraint movement?
CFraming a platform or elevator doesn’t move a player because it’s an Anchored item and it doesn’t move physically.
If you want good movement on an item like this you should look at using physical Constraints.
I’ve made a sample platform for a previous forum post:
https://www.roblox.com/library/7645980152/PlatformModel
Heres something that’ll help with resolving that, to OP, just make sure to update with workspace:Raycast using RaycastParams. Also change lowertorso to HRP if you want compatibility with both R6 and R15 (just use rootpart in general).
Adjust and update as needed of course.
@Judgy_Oreo’s script Probably also works as well in the sort of same manner. Just make sure the connections are disconnected
Where would I put this script?
So you want this in the Character. I’m pretty sure that it needs to be in StarterPlayerScripts.
The script doesn’t work with streaming enabled, is there a way to fix this?
I think I know why. Change the line
local HumanoidRootPart = Character.HumanoidRootPart
to
local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
I’ve also changed some other stuff to make it easier to use for custom characters
I should have mentioned that