Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | osemoka |
Hi!
I’m pretty new to Godot and it’s my first post.
I can move around the Engine as an app, understand where are the elements etc., but I have problems with understending the physics.
I want to create simple scenario when a character is standing on the floor, can move left, right and jump to bounce a ball on collision. The bounce direction would be based on the collision point of CapsuleShape2D
I created CharacterBody2D with its default script for character and floor with StaticBody2D node. It can move and jump with no problems. I assumed that CharacterBody2D Node is suited for this kind of player behaviour.
The problem starts with the ball implementation. What type of Node should the ball be?
Firstly I though about RigidBody2D, so it can be affected by engine physics, but it got problematic. The ball is moving, teleporting, stopping my character on contact.
Also the problem is with ball applying impulse, looks like it only gets it every other time (?).
Should the ball be another kind of a Node ? Or is it just a matter of correct code?
Can you point me at the right direction here? Types of Nodes for Player and Ball would be a good start. Then if possible some code tips. Function to use.
I want to mimic the behaviour of Blobby Volleyball game.
My poor codes for Ball and Character: