Wall stick/Gravity Controller

I’m trying to create a train were players can stick on, that’s why I don’t want players sticking on walls or roofs I just want them to stay and stick on the floor to move with the train.

Hey! I am making a project needing this but is there any way I can uset he gravity tool without it equipped aka no matter what, the gravity controller works even without the tool?

you will have to edit the code and make it ignore parts with the attibute ‘Wall’, then add the attribute ‘Wall’ to your train walls

Would there be a way to have it work the other way around? Like the wallstick ignoring everything else but the floor? I also create trains, and a way to allow a character to walk around stably in a cabin while moving would be revolutionary for I and lots of others.

You can make the gravity controller ignore parts without the attribute Floor, then add the attribute Floor to your train floor.

Important, Experience-Breaking: Line 193 in the PlayerScriptsLoader for the Gravity Controller makes the whole experience unplayable.

You can see this happening for yourself in the open source experience: Gravity Controller - Roblox

My fix was to comment out this line. Everything seemed to return to normal after this.

2 Likes

Fixed in the place file. Have yet to update the repository though.Thanks for the report!

5 Likes

You should also fix the GitHub Rbx-Wallstick, it is broken:

  • The line 193 of the PlayerScriptsLoader breaks the script, due to Roblox’s latest VR update
  • Sometimes jumping will send the character far away
  • The player doesn’t collide properly with curved and moving parts

Already fixed for the VR update days ago.

Regarding the other two points you either have to give me a consistent reproduction or make a PR yourself if you know the issue.

2 Likes

When I try your game, this is what happens to me when I go on moving or curved parts:

All of the mentioned bugs (except the jumping bug) always happen in the repro.

Still can’t reproduce. What’s your hardware?

1 Like

Is it possible these bugs are caused by the fact that I have a very poor internet connection?
I heavily doubt since I they also happen when playtesting alone in Roblox Studio…
anyways, here is the answer to your question:

iMac Retina 4K, 21.5-inch, 2019
Processor: 3.2 GHz 6-Core Intel Core i7
Memory: 16 GB 2667 MHz DDR4
Graphics: Radeon Pro 555X 2 GB

Also, I just noticed that when these bugs happen, the PhysicsFloor part occasionally disappears and reapperars so it looks like it’s a collision detection issue:

@EgoMoose I just realised that my bug only occurs when my cursor is on the chat! Really weird!
Please try to reproduce the bug again, but this time by positioning your cursor on the chat.

1 Like

Hmm, that’s a really weird but, but you’re right it is consistently reproducible. I’ll def look into it, but tbh since it’s such a weird one it might take me a while to find the cause.

3 Likes

@EgoMoose I found a very simple way to fix the bug without causing other problems! :partying_face:

It’s as simple as connecting the onHearbeatStep(dt) function that is inside the Boots module script to RenderStepped instead of Hearbeat. In other words, you have to replace the line 80 with this to get rid of the bug:

wallstick.Maid:Mark(RunService.RenderStepped:Connect(onHeartbeat))
4 Likes

Is there any possible way to blacklist a part so the system won’t let you stick to that wall? I’m building a tower of hecc type of game with this system and I don’t really wanna let players be able to exploit certain parts to cheat the game. Thanks!

I changed the WALK_FORCE variable from the default 200 / 3 to 200 / 140 and the players walkspeed to 70 in order to create a sort of low friction slipping effect. But i found this also causes the player to slip downward on slopes instead of staying still. Is there anything I can change to keep the sideways slip but get rid of the downward slip when they’re on slopes?

Functionality I want after slip is applied:

What actually happens when slip is applied:

2 Likes

This is brilliant, but how are you detecting even changes with body movers, if I recall, :GetPropertyChangedSignal() (which I’ve used for a system to prevent players from falling off fast moving platforms and which is what I’m assuming you used) doesn’t pick up updates from body movers, How did you do it?

you could probally use a script that sets it in the right places.

I took this a step further by merging onHeartBeat into onRenderStep to reduce the number of function calls. I haven’t run into any issues with it so far.

local function onRenderStep(dt)
	if renderStep then
		wallstick:Set(raycast())
	end
	
	local part, normal = raycast()

	local t = os.clock()
	renderStep = false

	if t - prevTick > 0.3 and part ~= wallstick.Part then
		updateTransition(part, dt)
		wallstick:Set(part, normal)
		prevTick = t
	elseif part == wallstick.Part then
		if normal ~= wallstick.Normal then
			updateTransition(wallstick.Part, dt)
			renderStep = true
		end
	else
		updateTransition(wallstick.Part, dt)
	end
end
1 Like