I'm having a strange problem... in 2D grid battle tutorial, when I move the collider on the princess prefab to sprite child object, the trigger machine does not get triggered by the princess, whatever "start by root" is checked or not, it doesn't work.
When I move the collider component back, the trigger machine works fine again.
I thought that the collider component on child object could not fire OnTriggerEnter2D method, so I mounted a script with only OnTriggerEnter2D method on the trigger machine's object to test it and found that it could trigger.
Am I setting something wrong?
One more question, is there any suggestion about getting in and out of the houses on the tile map? Since there are a lot of houses, I don't think it's a good idea to use teleport...
thanks for your time.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
The reason for this requirement is that my collider only covers the lower half of the character's body, and if I put it on prefab root, the collider will rotate with root object when character moving.
Sorry for my poor English, I might not be able to describe it clearly... I wish I could upload a video!
On another question, I can currently think of expanding the Change Position node, so that it can move to a marker point similar to spawn point, which is identified by id (The tile map of house is located in the same scene, away from the large map). Is there a more recommended solution?
Thank you for your help!
So that just leaves question 2. @gamingislove Please help this noob...
As for the Change Position node - the easiest way would be to find that game object you want to move to. You can either use a Find Object type actor or the Search Objects node to search for (active) game objects in the scene by name, tag, components and other filters.
Use the found object in the Change Position node to move to.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
The only difference is that I stored the results from FindObjectsOfType() in a singleton since access to the house is very frequent.
Thanks again for your help!
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!