Wall stick/Gravity Controller

The gravity controller wouldn’t work as well as the wall-stick controller, but they both should work.

1 Like

What scripts from Wall stick controller new camera - Roblox do I need to yoink for this to work? Just the wall stick client and server?

2 Likes

Every script in that place needs to be “yoinked” except for the example main. That’s just an example of how to use the module, you may want to use it differently.

2 Likes

Am I missing something? Seems to not work for me and no errors either.

1 Like

The example main runs the module. You can use it if you want, but it’s just an example of how to use it. For example you might only want to the players to stick to certain parts and not others. The modules are just a set of tools for sticking to things and changing their gravity. The conditions under which that happens is up to the developer.

1 Like

@EgoMoose From the old topic: Smooth player standing on the train system? - #9 by EgoMoose I have managed to make a good train platform system. It seems like the only thing I need is the camera rotation. How did you make the camera rotate when standing on the spinning platform? Like the camera follows where it is facing

@EgoMoose, I don’t need the wallstick anymore. I only need camera rotation.

I’m trying to create a reverse dropper game where you go up instead of down. Is there a way to control the time you could levitate in the air for and if you hit something in the air you basically fall back down to start.

I don’t know if this was asked before or not…
I want to disable collisions between players while using this controller but I get a huge glitch when doing that: If a player walks inside an idle player, the idle player’s HumanoidRootPart will move in random directions.

Is there any way to fix this?

EDIT: I just discovered this glitch only appears with R15 avatars.

Thank you for creating this, I was wondering on how developers make these kind of things. I appreciate it!

2 Likes

How do you keep momentum in the wall stick module? I want to preserve the player’s velocity when running off an edge but because the player is CFramed it doesn’t work. Is there a workaround for this?

I started using this a while ago but is there a way to make gear upside down, like the player?
And I also fall into the void

2 Likes

Hey Ego, amazing resource I must say. Can’t wait to weld a light jet onto a track and see how it goes :eyes:

I have a query however and I’m struggling to solve it myself, with the Wallstick module as you may already know it works sometimes with Terrain. Now I’m not particularly bothered about it trying to stick to a terrain floor however I’m trying to make it so the terrain retains its collision with the player character. Is this at all possible and how would I go about trying to achieve this?

Reason being, myself and a friend are trying to make a Tron game and if you’ve ever watched the film you’d know in the game arena it flips about making wall stick required and parts of our map are cave system terrain meaning we’d need terrain gravity - I tried merging the two to no avail.

I’m considering raycasting the front view and then doing the :Destroy() method like before but I was wondering if their is a way to override the collisions.

Edit: I have a 99% of the time working method for terrain collision which has less errors, but I’d like to hear any ideas you have - would you like be to share the method with you?

1 Like

So this is a great question!

Unfortunately with the wallstick controller you’ll never get any terrain collision so you have two options:

The first as you suggested is to destroy the wallstick controller when you get close to terrain. For this I wouldn’t use a raycast, but instead a region3 because otherwise if the floor isn’t directly below then you’re as good as goof’d; you’ll walk right through.

The second method is to create a hybrid of the two controllers. Now I can’t give you an exact method for the conditions under which one enables and the other doesn’t because that will be highly dependant on your game. Up until very recently this would have been a bit difficult, but I recently made some silent changes to the wallstick controller that make it work more nicely with the gravity controller exactly for that purpose!

I put a demo together for you where it transitions to the gravity controller when walking on terrain, but you may want to default to the gravity controller and transition to the wallstick when on a moving part. It’s all up to you.

https://www.roblox.com/games/5356010566/Hybrid-Wallstick

Good luck! :+1:

17 Likes

Already used the region3 and reading the voxel data, works quite well but obviously isn’t fool proof in respect that the wallstick would switch off the moment it detected terrain. It also had extremely confusing physics on terrain in that it would alternate constantly when in mid air.

Remarkable speed on merging the two together I must admit - complete life saver and I’m going to use it as it handles a lot better with crossing from part to terrain. Your current method is light and barely has any effect on the speed of the game so I’m going to have no need to transition - plus the map is quite crossed between terrain and non-terrain so either way it would have minor effects.

A final question:
Does the system require the animate script at its core, or through editing is it possible to remove it (in regards to the fact the Roblox animation script obviously is a lot smaller and was wondering if it was a fundamental part of the code)?

  • I’m not one to edit code unnecessarily in response to the fact that it does the exact same at its core.

Life saver:
https://gyazo.com/9fc58c53935f7f36e8501e9bf1bf729b

1 Like

Yes the animate script is essential. Both the wallstick and the gravity controller require it to properly use your avatar animations. It’s just a modified version of the roblox scripts that lets me have control over a few more things, but most of that code is vanilla Roblox.

1 Like

Do you think it’s possible to modify the wall stick to be regionally triggered (like if you walk through an invisible block you fall to that section)? I want to make a artificial gravity rotating wheel space station segment but if for the bulk of the space station you’re floating around, I don’t know how to establish the player to walk on a specific surface if they’re not already walking on one. Especially for as they have to go down the ladder to get to it I just don’t know how to do that section.

Here’s an example (this is from the Wiki page for the Nautilus-X, which was planned/designed for the ISS but never approved):

Yes, you could absolutely do that.

Region3, a touch event, many community modules all great places to start!

2 Likes

I have no idea if it’s interesting but I created a spectate system that supports the gravity controller: https://www.youtube.com/watch?v=2NbDbrWtMVA&feature=emb_logo

There are a few (but very minor) glitches, however if many people are interested I might make it public.

After some attempts on trying to make the all scripts compatible for custom characters I could not manage to fix some variables that caused the script to break because the characters in my game do not have the same object names and locations that require your script to work. Since I never wrote these scripts it’s a pain trying to figure out what goes where and how I would fix things.

Do you think it’s possible to make this universally configurable to allow support for custom object variable names to easily change stuff and not rely on default character parts?

Parts that are ignored by the Gravity Controller have the following problems:

  • There is a sliding effect with tilted parts, spheres, wedges and corner wedges.
  • Jump power is reduced when walking on tilted parts, spheres, wedges and corner wedges.

How to fix these issues?

EDIT: I was able to fix these issues by using a BodyPosition!