Strange Physics when scaling the character

I have a strange issue when I am scaling the players character. When I scale the character larger than default, they become “floaty” meaning when they jump, they jump very high and hang for a long time. When I scale them smaller than default, they become heavy and can barely jump at all. This is exactly the opposite of what I would expect.

Te verify for myself the character mass for myself, i wrote a little script to calculate the total mass of all the character parts. For example when at default scale my mass is: ~14.322 and when my scale is 5X default my mass is: ~1790.311

If my mass is higher, then shouldn’t gravity pull me down faster? Why instead do I float at larger scales?

I am leaving the JumpPower at the default of 16 at all times. I have tried changing the jump power to compensate for this behavior but the results are not desirable. the character still is floaty and in some cases does not connect with the floor properly.

5 Likes

Everything falls at the same rate in a vacuum, regardless of mass. This means that an ant will travel the same distance in 1 second in free fall as an elephant.

But here’s the thing: think about this from the ants and the elephants perspective. For the ant, he has just travelled a tremendous distance at high speed relative to its size. The elephant has barely moved more than his body length.

Why am I saying all this? The end result is that large objects will seem floaty and slow, and small objects will seem to fall fast for their size.

This principle is often missed when making large objects. Think about the first Pacific Rim: The robots are convincingly large because they lumbered, punch’s took a long time to wind up and connect, the robots strides took ages and had significant air time.

Edit: I don’t recall large characters having trouble connecting with the floor. For a quick solution, just slap a body force into the root part pulling the character down more as their size increases.

3 Likes

OK what is happening is that when a character is 5x its normal size, it jumps EXTREMELY high in the air,. something like 50x times the characters own height. Using the example above of the elephant and the ant, in this case the elephant is capable of jumping over a skyscraper while the ant can barely move because gravity is nearly crushing it.

This behavior has nothing to do with falling actually, the floaty behavior I have described was just part of the story. With JumpPower remaining at 16, why does a large character jump so high that it seems like they are flying?

Also, I do understand that a BodyForce will be needed to adjust this, but without understanding WHY this is happening, I would only be guessing at what numbers to apply. I can get the characters mass,

I don’t recall having this issue, but it’s entirely possible I solved it then forgot about it. Or still have the issue and forgot about it. I’ll update you next chance I get to use my laptop.

My guess is that the jump height is proportional to character size, but you said reducing the jump power gives bad results, can you give me more details on that?

1 Like

Are you doing something wrong? JumpPower defaults to 50 (not 16), and what it signifies is the velocity Roblox sets your character to when you jump. All objects fall back to the ground at the same rate, so the character’s size and mass will not affect this. To clarify, we can find when the character stops and begins to fall back down with:

vf^2 = vi^2 + 2g*x (x = displacement)
0^2 = 50^2 + 2*(-196.2)*x
-2500 = -392.4*x
x = 6.371

Mass and character height are not present in that equation, so displacement will always be 6.371. Testing in play solo, this appears to be the case:

https://gfycat.com/BoilingAmazingBug
https://gfycat.com/AfraidGiantDeer

It sounds like you’re using something custom. Can you upload a repro file? Otherwise it won’t be possible to help you, as there are any number of ways you could have changed characters.

3 Likes

I can confirm the same results as EchoReaper. Changing the character size has made no difference to the character jumping, or indeed any other characteristics. The only noticeable difference was a tendency to phase through some of the smaller bricks.

1 Like

OK I have done some more digging into things and I see now that all the objects regardless of mass are falling at the same rate.

It turns out that I was scaling WalkSpeed by the same factor I was scaling the character size to get them to walk at a visually normal speed, and I was also multiplying JumpPower by that same factor. This was my own error, obviously.

Some of the floaty effect that I was talking about was that players are able to topple each other over by simply pushing them around, especially if they had non-standard animations on their avatar. I also noticed characters being tripped by landing on oddly shaped parts. This sort of behavior conflated with my improper scaling of jump power led to me to believe there was something going on weird with physics when scaling.

That said, there IS something weird going on with physics when the player is at scale, but I think that I can overcome it with a few fixes. I have already “fixed” improper accessory scaling by cloning the players accessories, destroying them, then parenting the cloned ones to the character again.

Now I need to fix the jump issue at hand. What I need is the player to appear to be jumping to the normal playerheight/jumpheight ratio at all scales. I haven’t discovered any math that makes sense to me to do this.

For example, if the player is scaled 5x their normal height, a JumpPower of 70 gets us pretty close.

This is weird. If the character is 5x the height and 5x the mass, wouldn’t 5x the JumpPower make sense? Instead we are scaling JumpPower by 1.4x

My current approach is to just manually tweak numbers for the JumpPower at each target scale. This will probably work out fine. I am just super curious why it is this way.

Thanks to all of you who helped me out in this. I appreciate your patience in explaining to me what was going on.

P.S. I want to mark one of these responses as the solution, but they all were. Not sure which one to mark. what do you guys think?

@EchoReaper stated that the JumpPower is the velocity given to the character. So, using one of the equations for constant acceleration:

Vfinal^2 = Vinitial^2 + 2 * a * x

Where x is the height, a = -196.2, Vinitial = JumpPower, and Vfinal = 0 as at the top of our jump where we reach maximum height, our speed is 0.
So
JumpPower^2 + 2 * -196.2 * Height = 0
JumpPower^2 = 392.4 * Height
JumpPower = sqrt(392.4 * Height)

So if you want a character to jump 5 times higher when they are made 5 times bigger, you need to make the JumpPower sqrt(5) = 2.24 times larger.

3 Likes

I will try this when I get home but my first guess is that multiplying the default JumpPower of 50 by 2.24 would be too big. This would have JumpPower at 112. My guesstimate from eyeballing left me with a JumpPower if 70 looking sorta right.

That all said, I have been completely off-base thus far so I will try this asap and report back.

Thanks!