x


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

Matthew Dennis gravatar image

Matthew Dennis
53 39 30 36

(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

loopyllama gravatar image

loopyllama
1.5k 1 5 22

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

By RSS:

Answers

Answers and Comments

Topics:

x2970
x2182
x1085
x450

asked: Apr 28, 2011 at 10:05 AM

Seen: 1481 times

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