0 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.?

asked Sep 24, 2018 in Engine by Ruckus T-Boom (82 points)

1 Answer

+1 vote
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.

answered Sep 25, 2018 by eons (7,731 points)
selected Sep 25, 2018 by Ruckus T-Boom
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.