0 votes

Hi, so, I have a Character scene, like this:

Character: KinematicBody2D
| AnimatedModel: Node2D
| CollisionShape2D

then I made a NPC scene inherited from this:
NPC: Character
| AnimatedModel
| CollisionShape2D
| StayInPlace: Node

now, I want to set the model for my NPC (to, say "SorceressModel"), is it possible in c#? I think if I deleted the AnimatedModel then Instance a SorceressModel, named it as "AnimatedModel" could work, but I cannot do the deletion.


Also, currently, I have an alternative way when making my AI behaviour. like this:
I have a AIBase: Node to set the Character's brain. And a StayInPlace: AIbase for the NPC. but I cannot change the type, so:
- in Character, I just [Export] NodePath aiPath_;, then get it as AIBase in _Ready();
- then in NPC scene, I instance StayInPlace node, then set to aiPath_ in editor.

This works for now, but is not that straight forward. and I think, by this, we have a aiPath_ member in each Character instance for one use only.

Godot version 3.2.2
in Engine by (14 points)

Please log in or register to answer this question.

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 Frequently asked questions and 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 [email protected] with your username.