Hi … I am new with defold and I love it
I have a little problem here
I need to give the ball a certain speed (the speed bigger than the speed of player object) and let it moves in the direction of green arrow
Hi … I am new with defold and I love it
I have a little problem here
I need to give the ball a certain speed (the speed bigger than the speed of player object) and let it moves in the direction of green arrow
I’m not really good with kinematics but I would do it the following way:
impact by player from the balls point of view:
When the ball hits the wall from the balls point of view:
I think you will find some of the code your looking for in the breakout game example on this page.
http://britzl.github.io/publicexamples/
Oh, ok. Can we call that a feature?!
@britzl Why you didn’t use dynamic physics with applying force? In this way I found that ball’s physics is more realistic. Could you explain your decision?
MY SETUP
ball.go
collision_type: dynamic
mass: 0.075
friction: 0
restriction: 1
ball.script
msg.post("#collision_object", "apply_force", { force = vmath.vector3(5000, 5000, 0), position = go.get_world_position() })
game.project
gravity_y: 0.0
scale: 0.02
PREVIEW
The purpose of the example was to show bouncing kinematic balls.
Hi @britzl, thank you for reply. Can you help me? Why if I using dynamic collision my ball not collide with paddle from the paddle’s edge? Is any way to fix it?
Have you enabled physics debug in game.project? Does the collision shapes look ok?
Yes. You can see collision shapes in the second screenshot.
I can share github repo if you need.
Have you double checked the collision masks for both objects?
After enabling it, the shapes look.