Before updating to Windows 10 you may need to return your Pro license. More information here

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?

more ▼

asked Apr 28, 2011 at 10:05 AM

avatar image

Matthew Dennis
53 41 32 39

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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.

more ▼

answered Apr 28, 2011 at 11:46 AM

avatar image

1.6k 2 7 27

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 NUMBERS FTW, thanks btw

Apr 28, 2011 at 01:31 PM Matthew Dennis
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments



asked: Apr 28, 2011 at 10:05 AM

Seen: 1628 times

Last Updated: Apr 28, 2011 at 10:05 AM