Wall stick/Gravity Controller

After implementing this script into my planetary game I can say I’m incredibly thankful that this was made. You(EgoMoose) did a better job then I could’ve ever done and now I don’t gotta make my own, so thank you very much!

But I would like to add that I’m experiencing a bug(if it’s actually a bug) where if the player jumps onto an ignored part that’s rotated on a steep curve they can’t jump anymore until they fall onto a non-ignored part.

Throughout the video I am spamming my spacebar, so the points I’m not jumping are when the issue happens.

I get zero problems in console from what I’ve noticed.

If anyone has any ideas or has experienced this specific issue before then the help would be appreciated.

2 Likes

@EgoMoose the first person mode/shift lock rotation was always a little bit jittery with your Wallstick system, but I found a way to fix that! :partying_face:

(I added some code to the Control local script and the Boots/Teleport module scripts)
FixedWallstickRelativeCamera.rbxl (259.4 KB)

5 Likes

How would I use this to make npcs walk on walls?

Is there any way to make the codes not interact with certain parts? I noticed in the spinning platform, you have a part named ‘Ignore’, and it seems to work. But anything else I name ‘Ignore’ doesn’t work.

To add to this*
Is there a way to only choose parts from a list that are picked by this script, rather then creating a list of parts to exclude?

1 Like

Wish I saw this last week.
You can ignore as many parts that you want but it’s buggy as I’ve discovered.

for _, object in pairs(CollectionService:GetTagged("IgnoreObject")) do
	ignoreList[#ignoreList+1] = object
end

Put this after the:

for i, player in next, PLAYERS:GetPlayers() do
	ignoreList[i] = player.Character
end

section in the main script.

To add, the first bit requires you to make a new tag called “IgnoreObject”. From here put this tag on ALL parts you want to ignore.

3 Likes

is there a way to do this except parts have to be named gravity-part in order to NOT be ignored? (also do you know how to turn off the annoying script that corrects you when you fall too far (it is not needed in my game))

but mainly need help making a whitelist for this version of the gravity controller (so instead of ignoring all parts with the name gravity-part I need it so it ignores EVERYTHING ELSE)

Sadly I’ve only discovered how to add parts to the ignore list.
I to want to have the script only get gravity from a list of parts rather then all the parts in the game.
I could go into the depths of the code and look for a way, but that would take a while with my level of expertise so I won’t approach it until I absolutely need it.

I’m actually not sure. I’ve yet to come up with a better solution to this lol.

I’m still trying to adapt the scripts to work for npcs
If I am able to accomplish this I’ll update you on it

Currently: I’ve gotten it to the point where the “floor” part shows up in the npc’s character, but it doesn’t change to the new normals it approaches, so it’s always upright. To add, the enemy slides down slopes like people down slippery slides.

How to make a spider man tycoon game in under a hour :troll:

2 Likes

Is there a possible way to make the gravity controller always stick you to the nearest surface/part, so you can’t fall off? I am using this in one of my games and when going fast (around 60 walkspeed) the transition just doesn’t activate making this very hard to control, due to constantly falling off.

Is there a way to remove the camera manipulation? I tried to do it on my own and sort of succeeded but using shift lock messed up the character’s rotation.

I think you can do this by removing the custom PlayerScripts.

I tried doing things with the wall stick controller but everything I tried didn’t work. Also, how am I supposed to use the github because I see a lot of different codes in the files and idk which one it is.

This is a fantastic resource! but somehow when I was experimenting with its functions, I get this error when using :Destroy()?
image

Is it possible to make it only work for certain parts?

1 Like

How would someone be able to create a button to toggle the module on and off? as seen here:

That’s very simple: Since the gravity controller module was made with OOP, you can use the Destroy() function to disable it, and the new() function on to enable it.

I tried using new() but I could not figure it out since im not very good with scripting, but i ended up figuring out how to spawn with the controller off and to turn it on when you press the button, but the only problem is that it doesn’t turn off when you press the button again. The button basically moves the controller module from lighting to replicatedstorage which turns the controller on. I just need to figure out how to move it back to lighting and i believe it will then turn it back off. This is the script I wrote, I think I need to use an if - then statement but I am not sure where to put it and how to properly detect the controller.