Roblox breaking laws of physics?

It’s generally not recommended to use ApplyImpulse() on a player’s character directly from the server. This is because the character is owned by the client and changing its physics properties directly on the server can lead to desynchronization issues between the client and server.

One alternative approach you can consider is to use a RemoteEvent to send a message from the server to the client, and have the client apply the impulse locally. This way, the client maintains control over the character’s physics and the server only provides the impulse as a suggestion. Here’s an example of how you can implement this:

On the server:

-- create a RemoteEvent to send the impulse from the server to the client
local applyImpulseEvent = Instance.new("RemoteEvent")
applyImpulseEvent.Name = "ApplyImpulseEvent"
applyImpulseEvent.Parent = game.ReplicatedStorage

-- when the event is fired, apply the impulse to the player's character
applyImpulseEvent.OnServerEvent:Connect(function(player, impulse)
    -- get the player's character
    local character = player.Character
    if not character then return end
    
    -- get the humanoid and apply the impulse
    local humanoid = character:FindFirstChildOfClass("Humanoid")
    if not humanoid then return end
    
    humanoid:ApplyImpulse(impulse)
end)

On the client:

-- get a reference to the RemoteEvent on the client
local applyImpulseEvent = game.ReplicatedStorage.ApplyImpulseEvent

-- when the event is fired, apply the impulse to the local player's character
applyImpulseEvent.OnClientEvent:Connect(function(impulse)
    -- get the local player's character
    local character = game.Players.LocalPlayer.Character
    if not character then return end
    
    -- get the humanoid and apply the impulse
    local humanoid = character:FindFirstChildOfClass("Humanoid")
    if not humanoid then return end
    
    humanoid:ApplyImpulse(impulse)
end)

In this example, the server creates a RemoteEvent and listens for it to be fired. When the event is fired, the server sends the impulse to the client, which applies it to the local player’s character. On the client side, the client listens for the event and applies the impulse locally.

Regarding AssemblyLinearVelocity and AssemblyAngularVelocity, these properties control the velocity and angular velocity of the character’s root part. The root part is the part that determines the character’s position and orientation in the game world. AssemblyLinearVelocity sets the linear velocity of the root part, while AssemblyAngularVelocity sets the angular velocity. These properties can be used to move and rotate the character without directly applying forces or impulses to its parts. However, like ApplyImpulse(), changing these properties on the server can lead to desynchronization issues between the client and server, so use them with caution.

Another ChatGPT user on the forums.

2 Likes

Well, that wouldn’t work because then the client is unable to move the character.
By the way, I am using a custom model for the player’s character and using a LinearVelocity object created on the client on the character’s main part to move the character.

Not really, they can still move it. Though it is recommended to set back the ownership to its owner (It does this automatically after 5 seconds.). Also ApplyImpulse() called on server to client-owned parts will still work but it’s very limited.

They’ve been here the last week and a half. Just flag their posts as spam. Moderation will step in sooner or later.

1 Like

So I should just use ApplyImpulse on the client for client-owned parts? But why does changing AssemblyLinearVelocity or AssemblyAngularVelocity on a client-owned part work then?


It’ll still work but as I mentioned, its very limited and may cause latency issues. Not sure about others though, you can test it if you wanna.

All of these work on client-owned parts but NOT parts in a player’s character model. If you want them to affect a player character, you will have to do it on the client.

to answer the original question, the AI is indeed correct about Roblox having angular damping on rotating objects. to have a part rotate indefinitely you would have to constantly set its angular velocity, or use an AngularVelocity constraint

Oh, alright. Yeah I have also checked that the AI was correct about Roblox having angular damping, however there seems to be no documentation on the subject. Only old and perhaps outdated DevForum posts about it.

Why in the gods name is there a damn Chat AI bot in this forum

1 Like

Well due to how Roblox works you need to use the physical properties of the part as it is what controls parts mass, friction and more. You can also just script your own but keep the part anchored but that would require a lot more time than just altering the physical properties to your needs.

Roblox’s custom physical properties only control the density, friction and elasticity (amount of energy retained when colliding with another part) properties of a part. They do not have anything related to angular damping forces, so you would need to do something like in the solution or make your own physics (maybe overcomplicating the problem).

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.