ham
1
hi guys , ive got a serious problem in setting the speed of a rigidbody …heres my code
Blockquote
MyObject =Instantiate (Mark , SittingPlace ,transform.rotation);
MyObject.AddComponent(Rigidbody);
MyObject.rigidbody.constraints = RigidbodyConstraints.FreezePositionZ;
MyObject.rigidbody.mass =1.3;
MyObject.rigidbody.angularDrag =1;
var dist : Vector3 = Vector3(10.3, 7.8, 14.7);
MyObject.rigidbody.AddForce( dir* dist *.42, ForceMode.VelocityChange );
MyObject.rigidbody.velocity.x = 52;
MyObject.rigidbody.velocity.y =52;
Blockquote
its ok and object goes to a curve path but i want to have a faster movement , but with any parameter change , the path changes and object goes higher then comes down , but i only want a faster movement in the same path…
would anybody help me please
save
2
You would have to have a force that is from the opposite direction as well. I’m not sure about your current script - you first add force and then set velocity directly, which annihilate the previous added force.
MyObject.rigidbody.AddForce(Vector3(0,-someForce,0), ForceMode.VelocityChange);
I might not get exactly what you’re trying to do as I’m currently picturing a thrown grenade, rock or a pinecone, so I’m thinking you might want to use ForceMode.Impulse instead?
Make sure that you constantly add force over time as well, it doesn’t show if you’re inside FixedUpdate, where most physics code should live and breed. I’m thinking, probably not, cause you instantiate right before adding forces. The best thing you can do is to break it out into a function and then control your rigidbodies inside FixedUpdate, or you can do some while-yielding action, something of this matter:
var pineconeHasExploded : boolean = false;
while (!pineconeHasExploded) {
pinecone.AddForce(Vector3(0,-someForce,0));
yield WaitForFixedUpdate();
}
And remember, what goes up must come down. 
ham
3
after a long time suddenly i found the answer
no , the rigidbody isnt the solution
physics downs the frame rate of game and doesnt wirk properly…and totally you cant set the speed only , instead you shoud use bezire curve path …
and thats the only answer for it
check this…
http://gameprog.it/articles/58/create-bezier-curves-with-unity#.UjWioMZHKQm
thanx to anybody that answered