- Home /
is there any way to track the position of a certain point in the mesh of a capsule object?
is it possible to track the position of a certain point in a capsule object so it can be accessed even if the object is rotated? I know that I can add a tinny children object in that location, but maybe there is a better way of doing it.
I would like to know where is that point because the capsule is tied to a hinge and most of the forces should be applied to that point.
Thank you in advance :-)
PS: by the way, is it possible to obtain a rotation vector of the object? I know that there is the rotation attribute but it is a Quaternion, is there any way to obtain it like a forward-pointing vector or something like that?
Answer by Fattie · Dec 25, 2012 at 10:00 PM
Good news - that is definitely the correct, "industry standard" way to do it.
Simply add an "empty game object" ... often called a "marker" ... at the point you want.
There is no possible more efficient or better solution.
So, this is absolutely common, is seen everywhere, in vid games, 3D models and so on.
For instance a car model could easily have 10 or 20 or 30 of these. (Marking any number of things, like "bend between 'here' and 'here'" or "paintballs must hit within 35 cm of 'here'" or "this is the front right corner of the bumper" or "touch here to open the trunk" or (often just for developer convenience, not even for dynamic use) "cog is here" etc etc.
So you absolutely hit the nail on the head, great stuff. It's that easy.
Funnily enough this guy just asked a question, that is exactly about using such markers!
Your answer
Follow this Question
Related Questions
Top Down car/vehicle movement 1 Answer
Point Object Towards X/Z Position 1 Answer
Finding A Rigidbody's Rotation Speed And Direction 2 Answers
Rotating direction vectors 1 Answer
Direction of rotation and ApplyForce 1 Answer