#getting a weird problem in collision system

12 messages · Page 1 of 1 (latest)

viral perch
#

i am creating a typing game where user has to type words falling from the ground -- completed the basic functionality but when creating the collision system -- i'm facing a issue that words start colliding at middle of the screen rather than at the bottom -- i have placed the collision shape at the bottom.

words generate from below scene:

slate flax
#

Something to do with a RigidBody being parented to a Control

#

Which isn't typically done I think

#

Node2Ds and Controls don't interact well

#

If you'd like to make your Label move downward, you could do that pretty easily with some code. Something like

var speed = 5
func _process(delta):
  global_position.y += speed * delta
#

Then maybe attach an Area2D to the Label as a child, for detecting / being detected by the other Area

viral perch
#

Should I remove the rigid body and add area2d in it's place

slate flax
#

Yeah sounds like a good idea to me
One thing I'm not sure about though, is if moving the Label by changing its position, will properly update the collisions.

What I would personally do is use a CharacterBody2D or RigidBody2D as the root node of each falling word. Then add a Label as child.

#

The Area2D at the bottom can then detect a body, without it needing to have its own Area.

viral perch
#

yeah it worked..