with a simple code, I try to experient how magic the mesh.moveWithCollision(velosity) , I places 3 colorful boxes and the fourth box(crate) as my character. I expect the crate to move somewhere and even make some collisions, but it didn’t move at all, and hence no any collisions happened either. Can anyone helps to find out what’s up ?
the PG link is: Babylon.js Playground
Calling it on each frame makes it moving:
Thanks a lot!
moveWithCollisions is full of fun. it brought me a lot of surprise. Now I changed my character’s initial position , and try to reach the destination box(box4 ,the geen one).
PG link: https://www.babylonjs-playground.com/#EKKPEV#6
but It seems that the box had to be dropped down about a half height firstly (I guess that is because the gravity value of the moveWithCollisions was taking effect), then it began to move forward…and finally it did not reached the destination box.
Since I would like that the character mesh(boxa) moves with its body keeping above the ground while approaching its destination, rather than having to be buried a half,
because other boxes are obviously staying above the ground, while my character is dropped down. that seems unnormal.
Did lose somethng or misunderstand the usage of this function?
so what can mesh.moveWithCollisons( ) really do ? what is the purpose of this function? and what is the classic scenario to use implement this function ?
This is probably because the collision uses an ellipsoid as an impostor.
You have to play with the ellipsoid size to correctly wrap your character: