#jump force
1 messages · Page 1 of 1 (latest)
Is the inspector value 11 or 1? @fair sun
also don’t multiply by mass
if it’s 1 in the inspector, you’ll have to share more code
sorry for not responding i was away
the inspector value of 11 is the value that the player ends up jumping to
if the inspector value is 11, then the player will jump 11 units high
no the inspector value is 2
the player reaches 11
📃 Large Code Blocks
Large code blocks should be posted as links to services like:
https://gdl.space/, https://paste.ofcode.org/, https://hatebin.com/
https://paste.myst.rs/, https://hastebin.com/
📃 Inline Code
Surround code with three backquotes. Not quotation marks.
To get C# formatting the first line should only contain cs or csharp.
Add a comment with a line number if there is an error message.
```cs
// Your code here
```
Do not share screenshots of code unless requested.
surprised dyno worked here
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
syntax highlighting would’ve been fine, but oh well
remove the mass multiplication
it has no effect on the result
what is ModularPlayerPhysics?
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
also what’s the value of lowJumpReduce
like .5
what is the value of mass?
actually, better yet. Show the screenshot of the inspector
1
its pretty late sorry
Is it using all the jumpCounts at once?
no thats just for double jump
right… what I mean asking is if it’s using up both jumps at once
theyre not
i can double jump and that resulted in me jumping to 22
I think I see it now. Your custom gravity is actually super weak because it’s scaling by time delta twice
jumpForce = Mathf.Sqrt(-2f * jumpHeight * -physicsScript.gravityScale * Time.fixedDeltaTime)``` try that perhaps
ill try tomorrow but its pretty late today
thx
When you say it goes up 11 units. Is that an exact measurement or a guess?
like i see the value in the transform component
gets me very close to the value but never to the one i set
exactly how close?
well im in another thread rn and your result got me close by the decimal, but your method cant work for unity because unity's physics system is not like real life
I don’t understand what you mean on why mine won’t work for unity
because yours is based on real life gravity which is not how unity handles physics
because unity has a different way of making physics
A normal rigidbody uses the same equation.
Your’s is slightly different since your fall gravity multiplied by time delta twice which is slightly incorrect but the newer calculation should’ve compensated for that.
well it didnt
how off is it. the tenth place or the hundredth place?
.2 units
is it consistently .2?
idk, its very decimal but ive debugged the force and its always the same value
lemme test something out. How long does it take for your player to reach its jump height
time the jump
like .5 a second if i had to guess
and this is for jump height 2?
yes
huh, not what I expected
i mean i didnt count the jump length.
its about a normal jump
This is a full jump right?
like from ground to height
yeah its from ground to peak but the peak is shorter than the height i inputted
what’s the gravity force. I need that as well
gravityForce = gravityScale * gravityMultiplier;
gravityScale = 9.81
gravityMultiplier = 100
what’s gravity multiplier? I don’t see it in the scripts you sent me
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
changed it a bit
is it 100 because it felt floaty before?
yeah but i also make it stronger when falling
well its no longer applied
based on this new snippet:
playerScript.rb.AddForce(-transform.up * gravityForce * appliedFallForce, ForceMode.Acceleration);```
the new calculation should be
```cs
jumpPower = Mathf.Sqrt(-2f * -gravityForce * jumpHeight);```
This is assuming that your air drag is 0 and that fall force is 1 for the entirety of the upwards movement.
air drag is not 0 and the fall force is only applied once the player is already decending
but i think the drag might be the problem
drag is probably why then
is there a reason you have drag?
idk
set it to 0 and see if it feels ok
ill try tomorrow