![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | lucasfazzi |
So, I made a scene with a main 2Dnode called Characters;
Below, I put 2 Knematic2D nodes: Player and Enemy 1 (print1: Imgur: The magic of the Internet
);
I made the movement scripts to Player 1 ( print2: Imgur: The magic of the Internet ) and Enemy 1(print3: Imgur: The magic of the Internet ); Enemy 1 follows Player with a ‘get_parent().get_node()’ method.
But I was thinking; is there any way to individualize this with their own scenes?
Maybe a Player Scene and a Enemy 1 Scene? If I individualize, how can I link the scripts without a parent?
I was thinking maybe put a Level1 scene and inherit Player Scene + Enemy 1 Scene to make easy in the future, every Node with their respective childs… but how can i link Enemy 1 script to get Player info? How can I make Enemy 1 recognize Player withou get_parent().get_node()?
I’m a lil but noob and I don’t know how can I make this. Trying figure out with Class or add_to_group() but i don’t thhink if is the best way.
I don’t know why but image links is unstable and keeps crashing in imgur
lucasfazzi | 2019-01-21 22:39
Try to format your question in a better way next time, this was a simple one and was hard to understand, if it was complex, it would be almost impossible. Here are a few tips to write a better question:
- When adding code, o use `code` to short terms to do
this
os use the code formatting (beside the image icon) when writing more than one line of code - When adding images, use the image icon so who is trying to help you be able to the images here (remember to get the image url - left button>open in a new tab)
fpicoral | 2019-01-22 01:08