Godot Version
4.2.2
Question
how to implement pick-up items in C# in a 3D first-person game
I need the player to aim and press the interact button
you use ray cast then
I already realized that I need to use raycast but I can’t write a script
something like this
if (IsColliding())
{
var collider = GetCollider();
if (collider is iCollectable collectable)
collectable.Collect();
}
iCollectable name is suggest is interface
thanks
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.