Aligning the player to the ground
Blitz3D Forums/Blitz3D Programming/Aligning the player to the ground
| ||
I am trying to fix it so that when my player goes prone, he gets aligned to the ground. It's harder than it sounds. The player has a pitch and a yaw. Although I can find the normal of the triangle he is standing on, there doesn't seem to be any way to use that effectively. AlignToVector(entity,nx,ny,nz,2), and then applying the rotations, does nto produce the desired effect. |
| ||
Use instead of nx, ny, nz ObjectX + nx, ObjectY + ny, ObjectZ + nz AlignToVector aligns the object to a point so if it is only used with nx, ny, nz it will result in a wrong result normally. |
| ||
AlignToVector aligns the object to a point so if it is only used with nx, ny, nz it will result in a wrong result normally. No.. it alings an entity to a vector :). Just use AlignToVector, set to align your entity's Z axis to the vector. It will work. |
| ||
Hmm in that case the translated helpfiles are buggy. Thanks for the correction |
| ||
definitely alignTovector with a vector..I used it to let my soldiers go 'prone' against a wall, snake stylee.. works fine. |
| ||
Dude, you should be using axis 2, not axis 3, right? For some reason I am getting wack alignment. |
| ||
0,1,2 are the axes |
| ||
No, it's 1,2,3. I figured it out, it was because my terrain is scaledhuge, and I was using a vector in terrain space. |