문제

I am trying to spawn a ball in the world dependant on where the player (box) is at the time. to do this i need to know the position of the box and when i press a button the ball shall appear in the center of the top face of the box.

So for this i would need to be able the Y axis of the position also, and after searching online i cant find anything for help.

Anyone know how to help me with this?

Thank you.

도움이 되었습니까?

해결책

It's very difficult to give you an accurate answer without any code.

However something along these lines is what you are aiming for:

NxVec3 ballSpawn = box.getGlobalPosition();
ball.setGlobalPosition(NxVec3(ballSpawn.x, ballSpawn.y+boxHeight, ballSpawn.z));

The PhysX SDK Documentation has an excellent search function for the basics.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top