Can't get collision to work with animated character #443
-
Hi there, I am working off some tutorials and can't get objects to repect collisions. Here is the code. kaboom.js
main.js
scene.js
The 'faune' characters passes through the stone. Expected result is character will not pass through object. Any help is appreciated. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
Ohh is strange, what version are you using? |
Beta Was this translation helpful? Give feedback.
-
Can you check if the object has the correct collider in inspect mode? (Press |
Beta Was this translation helpful? Give feedback.
-
Here is a screen shot of both objects. Tried it using loadSprite and loadSpriteAtlas using anims property. ![Screenshot from 2021-11-21 18-00-28](https://user-images.githubusercontent.com/80294025/142786720-4dd0c717-9570-4daa-884d-189ba9305e9b.png |
Beta Was this translation helpful? Give feedback.
-
The mechanism to prevent solid objects moving into each other is inside If you want to directly assign |
Beta Was this translation helpful? Give feedback.
The mechanism to prevent solid objects moving into each other is inside
.move()
frompos()
component (it needs to know the velocity to prevent tunneling), if you're using directly assigning.pos =
it won't stop them from moving into each other.If you want to directly assign
.pos
you can also call.pushOutAll()
every frame to push the object out of every other solid objects, but that won't prevent tunneling when it's moving in high speed.