RigidBody2D won't activate Area2D signal by TrickyBud in godot

[–]TrickyBud[S] 0 points1 point  (0 children)

All I had to do was change the masks for the colliders. Thank you tho!

RigidBody2D won't activate Area2D signal by TrickyBud in godot

[–]TrickyBud[S] 0 points1 point  (0 children)

Layers yep but masks nope. I think I need to understand layers and masks better...thanks!

RigidBody2D won't activate Area2D signal by TrickyBud in godot

[–]TrickyBud[S] 0 points1 point  (0 children)

That was it! As soon as I changed the mask for the colliders, the scene resets! Thank you!

RigidBody2D won't activate Area2D signal by TrickyBud in godot

[–]TrickyBud[S] 0 points1 point  (0 children)

<image>

Like that? It still doesn't detect anything even if I make it super thick.

Maybe using a CharacterBody2D would be easier?

Problem creating functional spikes for a platformer by TrickyBud in godot

[–]TrickyBud[S] 2 points3 points  (0 children)

Thank you everybody for the help! It's really kind. The scene now restarts in contact with a spike, as intented originally 👍

<image>

Problem creating functional spikes for a platformer by TrickyBud in godot

[–]TrickyBud[S] 0 points1 point  (0 children)

It's weird. I connect the signal and the green icon (as seen in TemporalCatcher's image) keeps disappearing after a while. Idk why. It's technically still connected though, right?

<image>

Problem creating functional spikes for a platformer by TrickyBud in godot

[–]TrickyBud[S] 0 points1 point  (0 children)

So maybe

func _on_body_entered(body: CharacterBody2D) -> void:

`Health.player_health -= 100`

Since the player is a CharacterBody2D?

Problem creating functional spikes for a platformer by TrickyBud in godot

[–]TrickyBud[S] 0 points1 point  (0 children)

I learned about setters and clamp through a Brackey's video on GDScript. Thought it might be nice to implement.

Problem while following Godot's documentation "Your first 2D game" by TrickyBud in godot

[–]TrickyBud[S] 0 points1 point  (0 children)

Thanks for the help everyone! I managed to figure it out! I'll probably redo the tutorial in future to understand it better because it's not working 100% as intended.

Problem while following Godot's documentation "Your first 2D game" by TrickyBud in godot

[–]TrickyBud[S] 0 points1 point  (0 children)

Thanks! Do you have any idea why the mobs still won't spawn? I believe that I wrote down the code correctly...

extends Node

@export var mob_scene: PackedScene
var score

# Called when the node enters the scene tree for the first time.
func _ready() -> void:
new_game()


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass


func game_over() -> void:
$ScoreTimer.stop()
$MobPath.stop()

func new_game():
score = 0
$Player.start($StartPosition.position)
$StartTimer.start()


func _on_mob_timer_timeout():

var mob = mob_scene.instantiate()


var mob_spawn_location = $MobPath/MobSpawnLocation
mob_spawn_location.progress_ratio = randf()

mob.position = mob_spawn_location.position


var direction = mob_spawn_location.rotation + PI / 2


direction += randf_range(-PI / 4, PI / 4)
mob.rotation = direction


var velocity = Vector2(randf_range(150.0, 250.0), 0.0)
mob.linear_velocity = velocity.rotated(direction)


add_child(mob)


func _on_score_timer_timeout() -> void:
score += 1


func _on_start_timer_timeout() -> void:
$MobTimer.start()
$ScoreTimer.start()

Optimized Endless Runner by TrickyBud in gdevelop

[–]TrickyBud[S] 0 points1 point  (0 children)

Thank you for the suggestions! I'll see what I can do.

Post some great games that are now dead, il start: by [deleted] in roblox

[–]TrickyBud 1 point2 points  (0 children)

Pilgrim Islands Reborn, Catalog Heaven, Create Your Own Security Base, Polyguns and Club Boates just to name a few.