+2 votes

Is there a way to specify the type of a NodePath?

Say I have export(NodePath) var target, is there a way I can specify target should be a KinematicBody, Target.gd, etc.?

in Engine by (86 points)

1 Answer

+4 votes
Best answer

No, there is no way to filter by class.

If you need a restriction to avoid mistakes you can make a setter that checks, prints an error and ignore nodes of the incorrect type.

by (7,860 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.