#little problem with physics simulation

1 messages · Page 1 of 1 (latest)

trail mantle
#

v += Physics.gravity * stepTime;//stepTime = 0.05f, v is vector 3
pos += v * stepTime;//stepTime = 0.05f, v = vector3, grenade pos = pos here

bro what does this means ? i cant understand why and how it is done and what its work
https://paste.mod.gg/eelrfqgkjytj/0

karmic prairie
#

It's accelerating the object by multiplying the gravity by a fixed time step value (v = gt). Usually u want to use Time.fixedDeltaTime instead of a random value because it syncs with the physics step of Unity.

#

It's pretty straightforward if u just look at the textbook formula

trail mantle
trail mantle
karmic prairie
#

fixedDeltaTime is a float too ...

#

It's the interval in seconds between Physics steps

trail mantle
#

so it is like clicking a picture of my path and giving it to me ?

#

ig yes

karmic prairie
#

Well, there's nothing to "draw" the trajectory visually from what I've seen in ur code