Wall stick/Gravity Controller

do you think you can make one thats just a single script without having to put the modulescripts in places?

ive tried making my own but im having problems with it and i cant get it to work

1 Like

When I first joined Roblox I was always looking for something like this. I found something called Planetary Gravity a long time ago, but it wasn’t that great. This is literally everything I could ever dream of and hope for, good job at making it. Though, I still wish the gravity controller came with multiple “Ignore” parts just like the Wall stick controller did. I noticed people abuse this by jumping and sticking to another player’s torso, making them fly off the map.

4 Likes

You can do this with the gravity controller too.

Every frame I set the gravity up. I do this by checking for the surface normal underneath the character. You could easily adjust the raycasting to ignore certain parts. It’s exactly what I do in the wall stick controller.

12 Likes

I have a question. Does the gravity works to any of the vehicle?

8 Likes

Another update!

Since the gravity controller was so much more popular I took the time to clean it up a bit. The animation and custom state tracking should be a lot better now. In addition I implemented a lot of changes to the function that gets the floor normal. For example, it now ignores other players.

Most of the big changes come thanks to @EmilyBendsSpace’s work. I was able to implement a number of things including a much smoother function to grab the floor normal and the also get the velocity of moving/spinning parts.

Enjoy!

14 Likes

Yet another update, but this time to the wall stick. I actually published these changes to another place as I’ve yet to fully test everything, but as far as I can tell it’s working great!

As the title suggests I’ve completely redone the camera. This means we no longer have that ugly popper cam issue and we also now have the option to smoothly transition to new surfaces.

The big issue is when to actually do the transition and when to snap. If we do a smooth transition while on a constant “up vector” part then we get these ugly jitters. The best way I can think of right now is to manually define when to do the transition and when not to as the developer.

This can be set via Controller.TransitionRate = [0, 1]. Where 1 is instantaneous.

Please let me know if you find any issues!

19 Likes

Okay so weird story I was trying to make some sort of boat thing with the flying platform and may or may not have accidentally created the smoothest train ever.

44 Likes

Could you share the file of that?

3 Likes

Here is train for you
The Smoothest Train

17 Likes

There is an issue where if a player falls off a platform the player is still manipulated and may get stuck if the platform is not horizontal facing upward. Maybe add a timer so if a player is falling for more than a second or is lower than the surface they were standing on then set their gravity to normal.

4 Likes

For that you could either have it set so it would destroy the gravity controller part inside the player if they’re falling too much or you can have invisible walls that can act as a void for all sides of the world so the player would still die as if they fell to the bottom of the world.

3 Likes

One thing I’m wondering on how to change is the sensitivity to it. You can stick to a wall with a 90 degree difference although I’m trying to make it so you have to use a ramp to change walls. Does anybody know how to change this?

4 Likes

Change the conditions under which you set the new gravity normal

6 Likes

Keep up the great work wow! Love it this looks really cool!

2 Likes

Hello, i have a question. How do i make Trees don’t affect gravity?

I walk to the tree an it changes the gravity to the tree.

1 Like

Is their a way to prevent this sliding when you on the part but have a part of your body of the part a bit.

https://gyazo.com/8a5ada89298f1475c78635aa7006515e

4 Likes

Pardon me if I am misunderstanding, do you mean, “Prevent sliding when hanging over the edge of the part?”

3 Likes

I purposely do not add any default timers or things of that nature because i don’t want to discourage unique use cases.

You can add this in very easily by using humanoid state events on the PhysicsHumanoid.

4 Likes

Imagine how insane it would be to have some sort of 2D Platformer (like Super Mario Bros.) added with wallstick and gravity-control. There could be so many different puzzles and challenges to solve with only using wall-stick and the gravity controller.

I’ve tried combining the script for gravity controller and 2D Platformer scripts and it just breaks the gravity control script.

1 Like

I am not sure what you did but a 2D platforming script isn’t much more complicated than having your camera angled and restricting some movements of the character…

Just edit the cameraModifier and you will be good to go.

1 Like