- Home /
Applying force without rigidbody VRTK tutorial question
Hello everyone,
I was watching this video because I had some interest in VR development using VRTK v4. I wanted to follow the exact steps that were taken in this video, but sadly, the code in the scripts was not provided. Around 13:12 in the video, a shoot method is shown, which calls a different function in a file that was not shown because it was deemed "trivial". Here is where my question is located.
I tried recreating that trivial shoot function. The function takes a position, a forward vector and a float value as the force. My idea to implement this was to apply the force in the forward vector direction at the given position. From the unity docs, I found that I could use something like addForce, however, as was shown in the video, the script he showed did not include an input of a rigidbody on which such a function should be applied. Instead it only took the "arrow" that was attached to the "crossbow", but that object did not have a rigidbody(he explicitly deleted it).
So my question is: how should this type of "trivial" function be done, if not by doing it as described above? Is there a mistake in my thinking, or am I simply unaware of some unity functions? Do note that I don't have much experience with unity, which might explain the second point here.
If anyone could explain this, or guide me in the direction of where I can find the answer to this question, it would be much appreciated!
Your answer