Godot Version
4.2
Question
so i have two instances of a same sprite , and they both have collision shapes attached to them and all , but still they wont collide , lik , they get stuck together without colliding
4.2
so i have two instances of a same sprite , and they both have collision shapes attached to them and all , but still they wont collide , lik , they get stuck together without colliding
Are they in the same layer mask?
Yes they are in the same layer mask. Since they are instances of the same sprite
Can you post a image of the Cat nodes structure? And how are you moving the cats? Are you using move_and_slide() function?
like, they dont push each other away or they just past thru one another (overlap)?
ya they overlap and become one single sprite , uk if im not wrong , since ive given them a collision shape , there shd be some physical obstruction happening ryt ?
that isnt there
so i think the cats are clipped, since you teleported them to a position right?
have you put the move_and_slide() in the physics process of the cat? that should calculate the sliding
is it neccesary to move_and_slide() even if its just a pick and drop moevement and not a velocity based directional control movement ?
oh wait , it works now that i have added move_and_slide() , thank you soooo muchhhh! , sorry but can you explain why it was necssary to add that ??
it’s here explained : move_and_slide
it said
is intended to simplify the collision response in the common case where you want one body to slide along the other.
since you made them into collision to each other by teleporting, there will need calculation on how it will interact with the collision it got, since you didnt put the move and slide method in physics process, there will no calculation to move the cat when collided/overlap as to why it can slide with it
thankyou so much !
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.