I'm trying to figure out how to move my character from one object to another with each tap of the screen. Any ideas on how to do this? Thanks in advance.
Could you please give a detailed example? from the information provided, all I can say is to use a position animation node.
Thanks Josh. Please see the example provided below. With a tap to the screen, I would like to move my character (blue dot) to node 'A' at a predefined speed in a linear manner. A second tap would move the blue dot to the next closest node which is node 'B'. Lastly, another tap moves the character to node 'C' and so forth. Just want to see if this is possible. Thanks.
To achieve this you will need to do the following: - get the list of the points that you need to go to - sort that list based on distance from the initial location - get the first element and trigger an animation node from your point to that point - increment the next position - repeat the above
Thanks so much Vlad! Your solution works however, it will be quite tedious for me to set up the movements considering I will have hundreds or thousands of points in my game. Is there a way to have the character move to the next closest node wherever it may be on the screen? For example, my character initially starts out in a position where point A is closest so it would move there first. Then on the next tap, it would move to B as it becomes the closest to character.
For the above you may do the following: - Add a if collider that collides only with your possible points - Increase the size of that collider based on your expected ranged - Add entities and remove them based on collider value If true add them to an array list otherwise shift the first element out - When tapped sort the list and get the nearest point (exclude the first one since that might be the current point) - Get the position of the next point and animate to that point - repeat the top selection based on your click
Thanks Vlad. Sorry, I have a beginner question as I'm new to Buildbox and don't know how to code. Am I required to update the code in order to do the last 4 steps of your instructions? I can't seem to find array list and sort functionality within Buildbox. Below are the steps I'm not sure: - Add entities and remove them based on collider value If true add them to an array list otherwise shift the first element out. - When tapped sort the list and get the nearest point (exclude the first one since that might be the current point). - Get the position of the next point and animate to that point. - repeat the top selection based on your click Thanks for your assistance. Much appreciated!
I'm off for few days so I can't help you at this point. Just give it a try maybe you will find the way to do it without me/or until I come back to my pc Here is some code snippet that might help you with this let list = [] ; list.push(sender.collisionEntity()); list.shift();
Hey @DocQ Guess what? Today I felt a little bit better so I have something for you and for the community. If you have any remaining questions feel free to ask and suggestions are always welcomed here. https://vlad-ny.itch.io/move-from-node-to-node
Hi Vlad! Hope you're feeling better now. Just want to say thanks for all your help. It's exactly what I was looking for.
I'm fine now, thanks for the good thoughts. This wouldn't be possible if you did not shared your thoughts with us.