- Thread starter BornToGolf
- Start date

You're basically talking about manipulating gravity. I've asked for ideas and here's what I got :

https://robloxforum.com/threads/gravity-how-to-manipulate.30767/#post-145959

Code:

```
local Amount = 5 -- amount of satellites to generate
local Speed = 1000 -- rotation speed
local TweenTime = 1 -- base tween time. might be modified later depending on speed
local TweenService = game:GetService('TweenService')
local Theta = math.pi * 2 / Amount
-- part generation
local Model = Instance.new('Model', workspace)
local Base = Instance.new('Part')
Base.Shape = Enum.PartType.Cylinder
Base.Size = Vector3.new(10, 10, 10)
Base.Color = Color3.fromRGB(0, 255, 0)
Base.BottomSurface = Enum.SurfaceType.Smooth
Base.TopSurface = Enum.SurfaceType.Smooth
Base.CanCollide = false
Base.Anchored = true
Base.CFrame = CFrame.new(0, 20, -20) * CFrame.Angles(0, math.rad(90), 0)
Base.RotVelocity = Vector3.new(0, 0, 50)
Model.PrimaryPart = Base
local Satellite = Instance.new('Part')
Satellite.Shape = Enum.PartType.Block
Satellite.Size = Vector3.new(10, 5, 5)
Satellite.BottomSurface = Enum.SurfaceType.Smooth
Satellite.TopSurface = Enum.SurfaceType.Smooth
Satellite.CanCollide = false
-- generate satellites around the base, pointing at the center
for i = 1, Amount do
local Angle = Theta * i
local Size = Base.Size.X
local X = Size * math.cos(Angle)
local Y = Size * math.sin(Angle)
local Z = Base.Position.Z
local newSatellite = Satellite:Clone()
newSatellite.Color = Color3.fromRGB(math.random(0, 255), 0, math.random(0, 255))
newSatellite.Parent = Model
newSatellite.CFrame = CFrame.new(Vector3.new(X + Base.Position.X, Y + Base.Position.Y, Z), Base.Position) * CFrame.Angles(math.rad(45),0, 0)
local newWeld = Instance.new('WeldConstraint',Base)
newWeld.Part0 = Base
newWeld.Part1 = newSatellite
end
Base.Parent = Model
-- clamp speed. if speed is too high, adjust tween time
Speed = math.clamp(Speed, 100, 10000)
if Speed > 1999 then
TweenTime = TweenTime / (((Speed - 1999) / 1999) + 1)
Speed = 1999
end
-- generate tween info and a dummy cframe value to be used for tweens
local Tween_Info = TweenInfo.new(TweenTime, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0)
local DummyCFrame = Instance.new('CFrameValue')
DummyCFrame.Value = Model:GetPrimaryPartCFrame()
DummyCFrame:GetPropertyChangedSignal('Value'):Connect(function()
Model:SetPrimaryPartCFrame(DummyCFrame.Value)
end)
-- do the actual tween on a loop, adjusting the tween for its current position
while true do
local TweenCrusher = TweenService:Create(DummyCFrame, Tween_Info, {Value = DummyCFrame.Value * CFrame.Angles(math.pi / (1000 / (Speed / 2)), 0, 0)})
TweenCrusher:Play()
TweenCrusher.Completed:Wait()
end
```

So that could work to make the player go all around the brick?

Code:`local Amount = 5 -- amount of satellites to generate local Speed = 1000 -- rotation speed local TweenTime = 1 -- base tween time. might be modified later depending on speed local TweenService = game:GetService('TweenService') local Theta = math.pi * 2 / Amount -- part generation local Model = Instance.new('Model', workspace) local Base = Instance.new('Part') Base.Shape = Enum.PartType.Cylinder Base.Size = Vector3.new(10, 10, 10) Base.Color = Color3.fromRGB(0, 255, 0) Base.BottomSurface = Enum.SurfaceType.Smooth Base.TopSurface = Enum.SurfaceType.Smooth Base.CanCollide = false Base.Anchored = true Base.CFrame = CFrame.new(0, 20, -20) * CFrame.Angles(0, math.rad(90), 0) Base.RotVelocity = Vector3.new(0, 0, 50) Model.PrimaryPart = Base local Satellite = Instance.new('Part') Satellite.Shape = Enum.PartType.Block Satellite.Size = Vector3.new(10, 5, 5) Satellite.BottomSurface = Enum.SurfaceType.Smooth Satellite.TopSurface = Enum.SurfaceType.Smooth Satellite.CanCollide = false -- generate satellites around the base, pointing at the center for i = 1, Amount do local Angle = Theta * i local Size = Base.Size.X local X = Size * math.cos(Angle) local Y = Size * math.sin(Angle) local Z = Base.Position.Z local newSatellite = Satellite:Clone() newSatellite.Color = Color3.fromRGB(math.random(0, 255), 0, math.random(0, 255)) newSatellite.Parent = Model newSatellite.CFrame = CFrame.new(Vector3.new(X + Base.Position.X, Y + Base.Position.Y, Z), Base.Position) * CFrame.Angles(math.rad(45),0, 0) local newWeld = Instance.new('WeldConstraint',Base) newWeld.Part0 = Base newWeld.Part1 = newSatellite end Base.Parent = Model -- clamp speed. if speed is too high, adjust tween time Speed = math.clamp(Speed, 100, 10000) if Speed > 1999 then TweenTime = TweenTime / (((Speed - 1999) / 1999) + 1) Speed = 1999 end -- generate tween info and a dummy cframe value to be used for tweens local Tween_Info = TweenInfo.new(TweenTime, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0) local DummyCFrame = Instance.new('CFrameValue') DummyCFrame.Value = Model:GetPrimaryPartCFrame() DummyCFrame:GetPropertyChangedSignal('Value'):Connect(function() Model:SetPrimaryPartCFrame(DummyCFrame.Value) end) -- do the actual tween on a loop, adjusting the tween for its current position while true do local TweenCrusher = TweenService:Create(DummyCFrame, Tween_Info, {Value = DummyCFrame.Value * CFrame.Angles(math.pi / (1000 / (Speed / 2)), 0, 0)}) TweenCrusher:Play() TweenCrusher.Completed:Wait() end`

`newSatellite.CFrame = CFrame.new(Vector3.new(X + Base.Position.X, Y + Base.Position.Y, Z), Base.Position) * CFrame.Angles(math.rad(45),0, 0)`

I think would be the most helpful part, you'd probably have to play around with the angle a bit, but this is what positions the satellite and rotates it to face the center. If you got the angle right and worked in which face you were supposed to be perpendicular to, either running it with Stepped or updating the angle after the character hits a certain point might work. I could try some stuff out later, I've never done something like this so it could be fun lol.Thanks. My idea is there is a 100x100x100 that the players can go on all 6 sides of, making a very interesting FPS match.`newSatellite.CFrame = CFrame.new(Vector3.new(X + Base.Position.X, Y + Base.Position.Y, Z), Base.Position) * CFrame.Angles(math.rad(45),0, 0)`

I think would be the most helpful part, you'd probably have to play around with the angle a bit, but this is what positions the satellite and rotates it to face the center. If you got the angle right and worked in which face you were supposed to be perpendicular to, either running it with Stepped or updating the angle after the character hits a certain point might work. I could try some stuff out later, I've never done something like this so it could be fun lol.

That's interesting. But consider that the "planet" is not empty, there are a lot of items scattered all around. Some of them achored, some of them not. Imagine trying to rotate them all, at the same time, as the planet is rotating. Would be a nightmare lag.

Code:`local Amount = 5 -- amount of satellites to generate local Speed = 1000 -- rotation speed local TweenTime = 1 -- base tween time. might be modified later depending on speed local TweenService = game:GetService('TweenService') local Theta = math.pi * 2 / Amount -- part generation local Model = Instance.new('Model', workspace) local Base = Instance.new('Part') Base.Shape = Enum.PartType.Cylinder Base.Size = Vector3.new(10, 10, 10) Base.Color = Color3.fromRGB(0, 255, 0) Base.BottomSurface = Enum.SurfaceType.Smooth Base.TopSurface = Enum.SurfaceType.Smooth Base.CanCollide = false Base.Anchored = true Base.CFrame = CFrame.new(0, 20, -20) * CFrame.Angles(0, math.rad(90), 0) Base.RotVelocity = Vector3.new(0, 0, 50) Model.PrimaryPart = Base local Satellite = Instance.new('Part') Satellite.Shape = Enum.PartType.Block Satellite.Size = Vector3.new(10, 5, 5) Satellite.BottomSurface = Enum.SurfaceType.Smooth Satellite.TopSurface = Enum.SurfaceType.Smooth Satellite.CanCollide = false -- generate satellites around the base, pointing at the center for i = 1, Amount do local Angle = Theta * i local Size = Base.Size.X local X = Size * math.cos(Angle) local Y = Size * math.sin(Angle) local Z = Base.Position.Z local newSatellite = Satellite:Clone() newSatellite.Color = Color3.fromRGB(math.random(0, 255), 0, math.random(0, 255)) newSatellite.Parent = Model newSatellite.CFrame = CFrame.new(Vector3.new(X + Base.Position.X, Y + Base.Position.Y, Z), Base.Position) * CFrame.Angles(math.rad(45),0, 0) local newWeld = Instance.new('WeldConstraint',Base) newWeld.Part0 = Base newWeld.Part1 = newSatellite end Base.Parent = Model -- clamp speed. if speed is too high, adjust tween time Speed = math.clamp(Speed, 100, 10000) if Speed > 1999 then TweenTime = TweenTime / (((Speed - 1999) / 1999) + 1) Speed = 1999 end -- generate tween info and a dummy cframe value to be used for tweens local Tween_Info = TweenInfo.new(TweenTime, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut, 0, false, 0) local DummyCFrame = Instance.new('CFrameValue') DummyCFrame.Value = Model:GetPrimaryPartCFrame() DummyCFrame:GetPropertyChangedSignal('Value'):Connect(function() Model:SetPrimaryPartCFrame(DummyCFrame.Value) end) -- do the actual tween on a loop, adjusting the tween for its current position while true do local TweenCrusher = TweenService:Create(DummyCFrame, Tween_Info, {Value = DummyCFrame.Value * CFrame.Angles(math.pi / (1000 / (Speed / 2)), 0, 0)}) TweenCrusher:Play() TweenCrusher.Completed:Wait() end`

YesThat's interesting. But consider that the "planet" is not empty, there are a lot of items scattered all around. Some of them achored, some of them not. Imagine trying to rotate them all, at the same time, as the planet is rotating. Would be a nightmare lag.

Code:

Just asking there's an easy way to do that, I think if that was possible a very interesting fighting match could take place.

Because you've repliedwhy do i get notifications from this

Top left of the thread, there's an "Unwatch" button. I'm guessing it will probably stop the notifications.

I had a little time to play around with this today, I was just modifying a BodyForce object depending on where the HumanoidRootPart is relative to the planet. I might add an opposing force when changing regions so you don't float between regions, and I still need to add a BodyGyro, controls, and camera.so, in the end, the question is : how do you make your character get attracted/ pulled by a specific part ?

I'm open to other ways to do this if anyone has thoughts on it.

https://pastebin.com/H82nhf8p

ur smart af

Code:

The problem is the orientation of the character. It always stays in an upright position, perpendicular to the Baseplate, even if we delete the Baseplate. Instead of alwaye being perpendicular to the plane he's walking on. So i'm guessing we need to work on the body orientation.I had a little time to play around with this today, I was just modifying a BodyForce object depending on where the HumanoidRootPart is relative to the planet. I might add an opposing force when changing regions so you don't float between regions, and I still need to add a BodyGyro, controls, and camera.so, in the end, the question is : how do you make your character get attracted/ pulled by a specific part ?

I'm open to other ways to do this if anyone has thoughts on it.

https://pastebin.com/H82nhf8p

The way I've "solved" the character's body being attracted to a planet is to create a rope constraint. Works pretty well, except for when you have to jump. When you do that, the character is abruptly translated to the projection of the planet attachment point on the Baseplate. The planet's attachment point is (obviously) in the center of the sphere/planet.

Post automatically merged:

P.S. There might be different solutions for a spherical and a cubic "planets". For sphere, I guess we need to be working with a tangent function to solve the orientation.

Last edited: