aWeirdo Posted December 1, 2017 Share Posted December 1, 2017 Hi, I'm not 100% sure what's happening.. If meshPlayer.ellipsoidOffset.y is default 0 and you try to move on anything but a strait("flat") line, it bugs and collides instantly with the wall mesh without even being near. (See console.) E.g. destination.y = 1 && meshPlayer.position.y = 1 && meshPlayer.ellipsoidOffset.y = 0 === works, anything else doesnt seem to work unless setting ellipsoidOffset.y.. see lines 38, 47 & 49 & console. http://playground.babylonjs.com/#CBIPDN // Doesn't work, onCollide is triggered as if we hit the wall infront of us, even through we didn't. (no movement because of meshPlayer.destination = null; on collision detection) http://playground.babylonjs.com/#CBIPDN#1 // Works Any thoughts? Quote Link to comment Share on other sites More sharing options...
Sebavan Posted December 2, 2017 Share Posted December 2, 2017 http://playground.babylonjs.com/#CBIPDN#3 starts the animation the frame after the scene is ready to ensure initialization. Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted December 2, 2017 Author Share Posted December 2, 2017 Hi @Sebavan You're just re-applying the destination vector everytime onCollide removes it >BeforeRender >moveWithCollision -> onCollide triggers // This is the unexpected behaviour / bug, the box doesn't visually collide with anything. -> Removes destination >AfterRender -> set destination > Repeat Quote Link to comment Share on other sites More sharing options...
Sebavan Posted December 2, 2017 Share Posted December 2, 2017 lol yup sorry I meant this: http://playground.babylonjs.com/#CBIPDN#5 aWeirdo 1 Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted December 2, 2017 Author Share Posted December 2, 2017 Ahh, thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.