Debug.Log shows that vector3.forward is being applied - but the object isn’t moving.
I don’t comprehend why Time.deltaTime is causing this, as I thought it converted movements into seconds rather than frames. But it seems to be disabling movement in this instance - whats going on?
Your second line has one closing bracket too many.
Did you try increasing the speed to a higher value than 10?
Do you run the line of code inside FixedUpdate or Update?
Time.deltaTime is usually a small value (e.g. 0,02 or called in FixedUpdate, the fixed time step). Multiplying that by 10 is still pretty small value. In your first example, you’d try to add a force of 0,x each Update (or FixedUpdate).
Also note that using Time.deltaTime in combination with methods like addForce etc will probably not be what you expect, because the engine already uses the deltaTime internally.
I managed to solve problem while awaiting a response, it was like you said due to the speed.
As it seems Time.deltaTime has a certain translation ratio as it converts frames into seconds. I simply had to increase the speed (from 10 to 700!) to get the similar result as before Time.deltaTime.
They should mention this in the script reference, it would help a lot.
But i think suddoha is wrong on the second part. In my experience, addForce actually adds an impulse to an object. IE: A singular push of a certain amount of force over an infinitesimally small time period. So you DO want to factor in deltatime.
However, given that, a force of 10 whatevers (i have no idea what unity unity works on) is extremely small. To make my character run forward for instance, i’m using a force of 5000 per frame in early testing
No, it does the exact opposite, converts seconds into frames. You multiply a per-second value by it to get a per-frame value.
Time.deltaTime is the time that passed since the last rendering frame. However, you should NOT be using it for forces or anything physical. Such things should be done in FixedUpdate, not Update, and therefore you should be using fixedDeltaTime, which will give the time since the last physics frame.
In either case, you’re just not understanding what it is at all or how it should be used. the script reference explains it’s function just fine
You can decide how the force should be applied with a second parameter, the ForceMode, which is ForceMode.Force by default if i’m not mistaken. It will continously add that force to the object, while, e.g. impulse will add it instantly.
And the documentation somewhere states that using the force methods, the time related part will be done by the engine. Thus you only need to tell that method how much force you want to apply.
However, if you want to move your rigidbody manually without forces, you will most likely want to multiply it by deltaTime.
The time.DeltaTime property offers the ability to automatically get Time.deltaTime when used in Update, and Time.fixedDeltaTime when used in FixedUpdate.