Automatic walk with character object

10 December 2018 17:46
Hey all,

i am new to Blender and just learning it for 2 weeks.
I plan to create a city where you can walk throug the streets in ego perspective. Now i try to build in a kind of navigation mesh, where you click on a table (or something like that) with some destinations on it. So if you walk with your character to that table (which is on a place A in the street) and click on a destination B which is shown on the table, you would be automatically walk from A to B.

I build the character like the one explained in the user manual and attached a camera to it.

For the automatically walk command i add a object for the table and one hidden object for the destination.
My nodetree is looking like:

Entry Point -> Switch: Select [with table as object which you can hit] -> variable store [with a variable for the walk Speed] -> move to [with the character as object which should move and the destination object].

It works with objects, which are not defined as character. But when i try to move the character, it does not.

Could someone help me or has an other solution for me?
Thanks a lot and sorry for my bad english skills
10 December 2018 20:02
It works with objects, which are not defined as character. But when i try to move the character, it does not.
This is because character objects are physics objects and obey commands of the physics module, not the transform module.

If I understood you correctly, you're having a character object with first-person controls enabled, so you can run around with WASD. Then you want to take away user controls and make the character move automatically? You mean like in a cutscene in a game?

To do this, you have to:

1. disable FPS controls
2. detach the camera from the character (so that you can freely move the camera)
3. then you move the camera, NOT the character (the user will not notice the difference)
4. when the camera has arrived at the destination, place the character at the new location
5. re-attach the camera to the character
6. re-enable FPS controls

If you want to do this with Logic Nodes, you'll have to use JS_Callbacks to execute steps 1,2,4,5,6 because there are no nodes for that.
12 December 2018 13:14
Thanks a lot! I was testing and searching for misstakes, now i know it would not work with phyics objects

Your workflow seems a good idea. I will try it and hope i will be able to make it
Please register or log in to leave a reply.