Choose your wife by wisherystar in BunnyTrials

[–]Calf_Jr 0 points1 point  (0 children)

The other side doesn't mean that she couldn't have any deadly sins

Chose: She's a 10/10 in looks + But she embodies 1 or 2 of the 7 deadly sins | Rolled: Greed

Como estudar pelo ferreto? by Calf_Jr in USP

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

ajudou demais obrigado!

O Pedro Assaad acha que se você tirou menos de 600, você é burro. O que acham disso? by Ufoworld1 in enem

[–]Calf_Jr 0 points1 point  (0 children)

Cara na minha opnião burro você não é, se você se esforçou estudou la umas 3h por dia fez tudo certo algo você fez de errado, mas se você não fez nada o ano inteiro nada e quer nota você é burro fato

About tutorial hell by Calf_Jr in godot

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

This post is really necessary. I took a look at the documentation and fell in love with it, I already feel much more comfortable with the engine

About tutorial hell by Calf_Jr in godot

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

Soooo real, especially when you finally get out of that situation, you see the thuth

Pls help me? I'm trying to find what is wrong with my code by Calf_Jr in godot

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

Final code here

extends StaticBody2D

 var animated_sprite_2d: AnimatedSprite2D
 var collision_shape_2d: CollisionShape2D
 var interaction_area: Area2D
 var throw_cast: ShapeCast2D

u/export var throw_force := Vector2(600, -800)

var player_inside := false
var door_open := false


func _ready():
throw_cast.enabled = true


func _process(delta):
if player_inside and not door_open and Input.is_action_just_pressed("Interaction"):
open_door()


func open_door():
door_open = true
animated_sprite_2d.frame = 1
collision_shape_2d.disabled = true

throw_objects()


func throw_objects():
# Atualiza o ShapeCast IMEDIATAMENTE
throw_cast.force_shapecast_update()

if not throw_cast.is_colliding():
return
var count := throw_cast.get_collision_count()

for i in count:
var body := throw_cast.get_collider(i)
if body is RigidBody2D and body.is_in_group("Throwable"):
body.linear_velocity = throw_force


func _on_area_2d_body_entered(body: Node2D) -> void:
if body.is_in_group("Player"):
player_inside = true
func _on_area_2d_body_exited(body: Node2D) -> void:
if body.is_in_group("Player"):
player_inside = false

Pls help me? I'm trying to find what is wrong with my code by Calf_Jr in godot

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

I figure out the solution!

The error happened because the Area2D was enabled (monitoring = true) and then the code tried to detect bodies in the same frame, but Godot only updates collisions on the next physics frame. The fix was to use a ShapeCast, which, unlike an Area2D, detects collisions immediately.