I am a Newbie to Babylon.js - hence is this a cool and great tool - i created a scene with a ground, a box and a sphere. I figured out how to implement physics, gravity and collision detection to ground and sphere, and even am showing their boundingboxes.
If sphere falls through the ground it turns from green to red. So far so good. I don’t want it to fall through the ground - but on the ground therefore I tried to implement an animation to start a movement of sphere if she hits the box that lies on the ground - but actually, sphere just pretends to keep on falling
No clue what to do - so I got 2 questions:
a) how can i just let my sphere fall on the ground?
b) if impossible, how can I get my box solid, so that sphere won’t fall through? :))
thanks a lot for your guidance and fast response
I already added an elipsoid to my sphere (?) and set checkCollissions to true - as well for the box as for the sphere - but I am still clueless for nothing happens
I also found a demo on the playground which is pretty much what I need,
but actually I am unable to rebuild in my existing scene If i try just ends up in a white screen, so I am of the opinion that I might include another library to accomplish or anything else :)) any assistance would be highly preferred
so console is completley clear and empty, hence a warning shows up if i refresh the page: “A cookie associated with a cross-site resource at http://babylonjs.com/ was set without the SameSite attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with SameSite=None and Secure. You can review cookies in developer tools under Application>Storage>Cookies and see more details at [yadayadayada] and https://www.chromestatus.com/feature/5633521622188032.W”
Guess i just mixed something up, trying to set up the playground scene in a local instance to analyse and learn
ok so I came further with this actually I have a sphere and a ground. The sphere has a boundingSphere (yay, what else?) and the ground has a boundingBox. If the intersect each other, the sphere changes it’s color. YAY
But still sphere keeps pretending it’s most fun to fall straight into infinity, instead of bouncing or stopping or doing anything else when it intersects ground’s bounding box
What can I do to change this?
Here my snipplet of code - I just built this together from playground
Hey @Markus_Zeitlhofer, moveWithCollisions is commented out in your code. That method is required if you don’t want objects to pass through each other.
Changing a mesh’s position by changing position.x will move a mesh through other meshes even if checkCollisions = true.
I gave the moveWithCollisions a test yesterday but did not notice any difference in sphere’s behaviour. However, I will be keeping in learning and testing - thanks a lot for support and advice. Even though it might not look so, it helped me a lot.,