Part that change gravity

Part that change gravity and animation in touch

I have problem that gravity change sometimes (to different gravity that I didn’t add) and the animation don’t work somehow (the animation are fine)

function onTouch(hit) 

if hit.Parent:findFirstChild("Humanoid") ~= nil then
		local h = hit.Parent:findFirstChild("Humanoid")

		hit.Parent.Animate.fall.FallAnim.AnimationId = "rbxassetid://9994619922"
end
end

script.Parent.Touched:connect(onTouch)
script.Parent.Transparency = 1
parent = script.Parent

function onTouch(hit)
	if hit:FindFirstChild("NoGrav") == nil then
		local bf = Instance.new("BodyForce")
		bf.Name = "NoGrav"
		bf.Parent = hit
		bf.Force = Vector3.new(0,hit:GetMass(0),0)*workspace.Gravity
	end
end

parent.Touched:connect(onTouch)
1 Like

what exactly do you want the BodyForce to do? and where are both scripts?

1 Like

Inside part the gravity one its inside the zone part and the animation inside other part
I jump on the parts and the animation keep bugging and the gravity

1 Like

Tha Animation is not being played, you appear to be setting the AnimationId to a Player or Humanoid.

1 Like

I did it before and its didn’t work I guess but forget about that what about the gravity?

1 Like

Question, is it applying gravity to the player or the part?

1 Like

Its inside a part I dont rly understood what u mean, the gravity affect to the player

1 Like

Im just asking because it looks like 2 seperate scripts

1 Like

cuz it is 2 script
“Inside part the gravity one its inside the zone part and the animation inside other part”
I will comeback later

1 Like

can you provide a screenshot of this part and Zone?

1 Like


the smaller its the animation and the highest one its gravity zone
all in workspace

1 Like

So about the Animation, Make sure you change the Animation Priority Above Movement so it doesnt get overwritten by other animations, not sure if that will help but try it

1 Like

I dont rly sure i understood but u can help me with the gravity?

1 Like

Ok, Here are some questions,

What kinda of gravity do you want?
do you want it to float (0)
do you want it stay attached on a item? (196.2+)

2 Likes

Ok sorry I had to go for little
I need slowly fall for dropper game like the normal but little smaller
About he second I dont rly understood that sorry
no(if i understood true)

1 Like

Works for me, it slows down

script.Parent.Transparency = 1
parent = script.Parent

function onTouch(hit)
	if hit:FindFirstChild("NoGrav") == nil then
		local bv = Instance.new("BodyVelocity", hit)
		bv.Name = "NoGrav"
		bv.Velocity = Vector3.new(0,workspace.Gravity *2,0)
	end
end

parent.Touched:connect(onTouch)
1 Like

its work for me now

script.Parent.Transparency = 1
parent = script.Parent

parent.Touched:connect(function(hit)
	
	if hit:FindFirstChild("NoGrav") == nil then
		local bv = Instance.new("BodyForce", hit.Parent:FindFirstChild("HumanoidRootPart"))
		bv.Name = "NoGrav"
		bv.Force = Vector3.new(0,-20,0)* -workspace.Gravity/100
	end

end)

thx to MasterGoat (XGOA7x)

1 Like