Wall stick making player unaffected by any forces

Basically I got my hands on a modified version of EgoMoose’s wall stick system that allows the player to walk on other surfaces, like walls, the roof and so on, since it’s modified they can only walk on surfaces with a specific name. I also have a special field that applies a force / velocity to any object that finds itself inside of said field, it can be rotated in any direction and apply said force in that direction instantly (it was created by Konethorix). This means it can be used as basically a dynamic gravity system that could be used to make specific areas have different gravity forces, different positions compared to other locations, or make areas with zero gravity, even negative gravity, for instance for some kind of elevators, or even have the gravity rotate or change rapidly, it truly has a lot of uses.

This is where said problem appears though, basically, the wall stick system results in the player being completely unaffected by every other force except for physical objects pushing against the avatar. This means that the dynamic gravity fields are also not affecting the player (it normally affects the player without the wall stick, I did check). I want the player to actually be affected by such forces as the world gravity will be set to zero and we don’t have to worry about it interfering with how the rest of the script works.

I was thinking about leaving the world gravity normal and putting an anti-gravity script in every unanchored object so it’s in 0g until it is affected by said dynamic gravity field. It’s a possible fix for this issue, but it would greatly reduce the possibilities of the system as it would mean the player is always affected by the same gravity, can’t be in negative or upwards gravity as changing it would affect everything else. It is possible to give the player a different gravity and it works, but there’s this system that forces the user to calculate physics of nearby blocks which results in them gaining the player’s gravity value, I have stumbled upon this issue a while ago.

I even tried attaching a block to the player itself but it doesn’t seem to work really, if I remember right said force-based gravity field doesn’t affect attached objects and items when they are held. I think it worked when it was attached by rope but it was obviously quite, buggy. Perhaps if there’s a way to attach an object to the player that would not make the player buggy but pull them down with the use of the gravity field, it could be a good fix to this issue.

The script for said system is really complex so I will not put all of the scripts here, it would make this post massive, along with the description of where each script goes and how it should be named etc. For the simplicity I will instead attach the world file with bare basics (the modified wall stick system, gravitational field system and the surface a player can walk on) so one could try to play around with this issue.

Here’s the file of the world with the systems that I am using:
Gravity system.rbxl (189.1 KB)

I am really thankful for any help, really it’s quite a complex system and if anyone could do this I would be tremendously thankful, I can’t imagine my scripting getting to such a point where I can comprehend how this system even works, I know some people would think I shouldn’t work on it if I don’t have the experience, but I am really motivated, I believe it could be useful in many things like creating more realistic space simulators or just very bizarre games.

TLDR: wall stick system results in the player being unaffected by literally all forces other than the wall stick system’s gravity, resulting in a gravity field (that is supposed to pull everything it has contact with in a specific direction) not working on the character, and I want the player to be affected by the gravity field. I attached the file of a world that has these systems so it can be easy to work with, and make everything I am saying more clear.

1 Like

You need to put the force object in Workspace.PhysicsWorld[yourCharacterNameHere].HumanoidRootPart. The root rig attachment is also located there as well.

1 Like

Will see if that’s going to work!

Alright I tried it out, weirdly enough it does seem to work kind of, it is hard to explain but the forces are being applied to the block, but they are quickly removed, it works normally on the server side except for the fact that with the server view, the character has no collision and ends up falling through the floor quickly and obviously getting killed. Either it’s some bug or the wall stick system indeed removes the forces for some reason.

The block is indeed located in the character model, perhaps it should moved outside of the folder and it would not be impacted? Not sure how to do it with the script I am currently using though.

game.Players.PlayerAdded:connect(function(player)
	player.CharacterAdded:connect(function(char)

		local torso = char:WaitForChild("HumanoidRootPart") --You can change this to another body part

		local newPart = Instance.new("Part", char)
		newPart.Massless = false --You will likely want to set at least these properties
		newPart.CanCollide = false
		newPart.Anchored = false

		local weld = Instance.new("Weld", torso) --Could also use a Motor6D, or likewise
		weld.C0 = CFrame.new() --Both C0 and C1 are, by default, set to a blank CFrame
		weld.C1 = CFrame.new()
		weld.Part0 = torso
		weld.Part1 = newPart

	end)
end)

(credit: East98)

Here’s also a video that shows better what I mean:

edit: checked and it also happens when the block is not in the avatar group but just the workspace, so it might not work, not sure.

Okay I discovered something, APPARENTLY it works with the player normally when they are sitting, but when they get out of a seat it stops affecting the player, so if they are in the seat in a gravity zone and then jump up, the gravity will affect them always even after they leave said area and go into 0g, you only actually start experiencing 0g when you sit in a seat in such an area.

video for reference:

Is it possible to somehow utilize this?

edit: removed the video and replaced it with a different one.

Actually found where exactly the forces are supposed to go so they affect the avatar’s gravity, it is the so called “PhysicsWorld” which has the player within it- well just the head and root part, but this is what controls the avatar in many ways, something related to how the wall stick works- basically, the whole thing is local for everyone and it disappears when you sit down, but when you get up it appears with all these fancy positions that were perhaps copied after you got back up? In any case we basically need to get the forces into the root part in said physics world.

Also it doesn’t seem to clone itself if you delete it, and it prevents your avatar from moving at all, or doing anything at all really.

Yes, this is what I was referring to originally. Is there any issue with using the liminal character present in PhysicsWorld?

1 Like

It works fine but the forces are not being applied to the liminal character normally due to the fact it doesn’t make contact with the gravity fields, it only happens when the player sits down on a seat and then gets up, I think it’s basically removing the PhysicsWorld when the player is sitting because it’s not needed, for optimization basically, but because it’s recreated when the player gets up, it most likely copies the HumanoidRootPart and head from the visual character which results in them having the so called ‘FanForceAttachment’ and ‘FancyPosition’ with the ‘Whom’ value inside to be recreated as well, and that stays there until it’s reset again.

Oh okay I actually did not realize you were talking about the physics world as this specific folder- did not realize it even existed back then, I will try to implement that and see if it does anything!

1 Like

Yeah I cannot figure out how to implement it, and I am not sure if it would work, phantom world does not seem to replicate areas which have no collisions so it’s most likely why the gravity is not applied to the phantom character, and I don’t see how attaching a block to the phantom character would make a difference unless it’s displaced in a way it’s like, in the same position as the visible character- PERHAPS there’s a way to make an exception for it, some code which also replicates the gravity fields in the phantom world or something like that? Unless just attaching a block to it works somehow- would it be possible to modify the script I used and make sure it does so again when the phantom world is removed on sitting, and then created again when the character gets up?

You mean forces? Simply add a VectorForce object into the HumanoidRootPart and hook it up with an Attachment.

1 Like