- Home /
Does rigidbody.AddForce work for the iphone?
Most likely a dull question, but my line of code does not seem to want to work.
if (touch.phase == TouchPhase.Began && jumpo.collider.gameObject.tag == "player") {
jumpo.rigidbody.AddForce(Vector3.up * upForceOnTouch);
//jump = true;
}
I know the If statement works are the commented out line links to another if statement and it will turn an emitter on.
Any thoughts or suggestions to weather i should stick to this or move to another way of giving force?
Answer by loopyllama · Apr 28, 2011 at 11:46 AM
straight from the docs: "If you want to apply a force over several frames you should apply it inside FixedUpdate instead of Update."
perhaps it is adding the force, but the force is too small to see.
Aye the force needs to be extremely high to actually get it to look good, i had it set at 50 before, and that caused me to ask this question as it did nothing, i changed it to fixed updated aswel, did nothing. So i changed the force to 500 and i can see something happening now, CRASY NU$$anonymous$$BERS FTW, thanks btw
Your answer
Follow this Question
Related Questions
Make a player jump tile 1 Answer
raycast hit add force problem, help needed please 1 Answer
Detect screen tap vs. drag 2 Answers
Add impulse force using input.touch 0 Answers