×
Меню
Индекс

MSFD Collision detection

 
This is biggest headache of all. Objects will not collide with objects. Only character/NPC/creatures can collide with objects. In this term, objects means statics/activators and landmass. The only way to detect collision is when your character hit the object. That is why I mentioned earlier that if you select a big object to ride, you will see clipping until the moment your character hit something. If you can live with that, that's fine otherwise it looks pretty awkward. The simplest method to detect collision is to get your player coordinates and measure against the object coordinates ( the one you are riding on ). Although, this is not fully proven, using GetSquareRoot function in the object script can sometimes cause CTD. There are 2 planes that you need to take care of. For eg, the flying carpet uses detection for both vertical (z axis) and horizontal (x, y axis ) planes. You can refer to my script on how this is done. If somebody can come up with a better method, please do share it.