Wednesday, May 31, 2023
HomeGame Developmenthandle Kinematic object and how you can handle collisions - Cocos Creator

handle Kinematic object and how you can handle collisions – Cocos Creator

Hello to you all, sorry for this actually fundamental matter:

I would like to grasp how you can cope with a Kinematic RigidBody colliding with an object with a Static RigidBody.

I’m at present studying the documentation:

The issue although is that I haven’t found out what values I’ve to make use of to maintain monitor of how far I’ve to maneuver the article “again” in order to not depart it overlapping it.

In truth I merely must make it possible for my participant (whose motion goes solely to the suitable and left) to cross with a Wall should cease and never proceed along with his motion.

How ought to I do with out having to make it Dynamic?

What model of Creator editor are you utilizing?
your query it must be, simply collision detection to make the article cease, no must generate physics results.

Are you able to discuss with this demo and take a look at utilizing the collision detection operate?

hello, thanks for the response, however i used to be looking out a couple of Second context, not 3d. The model of Cocos Creator is 3.6.3.

For now what i discovered is the worldManifold methodology that i’ve to name with the contact Object. However i don’t know how you can handle it, there’s some instance or article ? :frowning:

Hello there, this query may be very fascinating, it’s fundamental however not simple. Let me head straight ahead to a solution: don’t use the builtin physics engine or the collision system in Cocos, attempt GitHub – Sinova/Collisions: Collision detection for circles, polygons, and factors if you wish to have an in depth understanding of the subject.

How good is that answer? For multiplayer motion sport use I ported the algorithm into Golang after which transpiled it together with different sport dynamics again to js for the frontend, and the result’s like [Video attached] Rollback Netcode on websocket with a Multiplayer Platformer sport demo open sourced – you may handle all “arduous pushbacks” and “smooth pushbacks” flexibly – which is sort of unattainable with a builtin physics engine. Good luck coding!

1 Like

Sorry, I misinterpret it, it’s a 2D physics drawback.
So for an instance of what you want, you may refer right here

1 Like



Please enter your comment!
Please enter your name here

Most Popular

Recent Comments