0 votes

So I am working on maing my forst game on godot. SO whenever my player is wall sliding the line 2D which I'm using as a trail is showing. I want to hide the linw2D while wall sliding but can't figure out how to do that.

Godot version 3.3.2
in Engine by (25 points)

1 Answer

0 votes
Best answer

I'm not entirely sure if this answers your question but here's what I would do:

For the player, be sure to have a collision shape/polygon. And from there, there should be a signal you can emit for whenever the collision shape collides with something. So you would connect that signal and then inside that signal function, you would get the node and hide it. So it would go by something like this:

func Collision_Shape_2d_Collided:
       $Line2D.visible = true

(remember that it wouldn't be exactly the same because i don't know what your nodes are named!)

by (48 points)
selected by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.