#Help with 2d Physics
1 messages · Page 1 of 1 (latest)
What code do you have for the bouncing part?
i'm currently just using built in stuff for the bouncing on the floor and i don't have anything for the "arms" because i don't know physics in the slightest
What type of node are the arms?
the arms are rigid bodies
that was my attempt to making it so i wouldn't have infinite collisions when the ball touches my arms
Why wouldn't you want it to have "infinite collision"?
Shouldn't it always bounce off?
btw, what is the code for moving the arm?
yes but i thought the problem was that the ball was colliding with my arms and just flying up them because of it
just one line for the arms
i'm brand new to this and i'm aware this is very ambitious
look_at() doesn't use physics. You must use one of the methods from RigidBody2D
like apply_impulse() or angular_velocity()
Phyisics are kinda complicated.
If anything, a StaticBody for the arm may work as well.
i tried making it so that the look at would work
thats my node setup
the node 2d is so that it has a pivot point
I am not sure if a bare Node2D works as a pivot.
Maybe with a Hinge of sorts.
but you're not using physics, so it is possible the arms are just asleep.
So they're not falling or anything.
aaah, that would do it.
Joint3D nodes should help.
But as a first project, i'd recommend doing some basic vector math for bouncing the ball instead of trying to play with advanced physics like these.
You could make all of this work with just CharacterBody if you wanted.
Ah, sorry, forgot you're using 2D.
You'd use Joint2D