- Home /
[VR - Vive] Throwing shurikens with modified speed
Hello there. I am working on a VR game for the HTC Vive in Unity, using the SteamVR asset, and for some time I have been stuck on the whole "throwing" thing. I can throw normal objects with the velocity of the controllers just fine... But when it comes to adding force to an object when throwing it (for throwing shurikens, etc) I don't quite know what to do.
Right now, I have a little script that I know is bad, but it's what I could think of. I modify the RigidBody's velocity's z
by multiplying it by 7
. I do it with these two following lines; rigidBody.velocity = origin.TransformVector(device.velocity.x, device.velocity.y, device.velocity.z * 7); rigidBody.angularVelocity = origin.TransformVector(0f, 1000f, 0f);
When throwing anything else (a ball or something), I use;
rigidBody.velocity = origin.TransformVector(device.velocity); rigidBody.angularVelocity = origin.TransformVector(device.angularVelocity);
As of right now, throwing the shurikens doesn't feel too bad, but not quite right either (if we skip the fact that it can only be thrown towards z
).
What I want is;
Adding force to a thrown weapon (its' velocity) in a natural way ("the right" way)
A shuriken not rotating like crazy to all angels, but like a normal shuriken would do (pretty much like the illustration here)
I haven't used Unity too much yet, and this is my first serious project - so please bear with me if I am missing the obvious here, note that this is also my first "Unity Answers" question.
Thank you for reading!
Your answer
Follow this Question
Related Questions
Simple breakout game issue 2 Answers
How do I accelerate particles in Shuriken? 1 Answer
Speed based on distance 1 Answer
Linear Velocity 1 Answer
Can an object to transfer to another as it increases your speed? 1 Answer