I have few model randomly created in game and i want them to move to specific location.
How can i make it happen?
i think you didât get me. I want to know if there is a method for make character move to specific location that i give or i have to develop algorithm for it?
I think I got you and its all described in the tutorials.
Iâm trying to learn the engine by writing a game, so, i wouldnât ask in here if i had find in tutorials. Just tell me how to do instead of giving me a link that i already know.
We had no evidence that you did the tutorials. Indeed, we had pretty good evidence that you probably didnât.
Nor was your question complete enough to answer, really. Since the simple answer that 100% answers the question as asked is:
Use character.setLocalTranslation(location)
We can only answer the questions that are asked.
Maybe you can explain why the specific tutorials that cover this (that you already read) didnât provide you with the answers you needed. That would help narrow it down.
Hehe, you have a funny approach to making people help you, did it ever work?
are you guys kids or just drunk? did you really read what iâve write? iâm asking to you; there is bunch of mobs that randomly spawning in game, and i want them to walk to a location that i give.
I have no idea how can i make this question more clear for you.
Iâm asking a question to you and you are giving me link of tutorial, btw i didnât even say, i wrote those. If you canât understand people those are beginners and if you donât know how to read, you shouldât even guide them.
if you are going to write another stupid thing just delete the freaking topic.
This is the first mention of âwalkâ in this whole thread. This is EXTREMELY useful information. You understand that âmove an object to a locationâ is different than âmake an object walk to a locationâ, right?
No one ever said you wrote the tutorials⌠but you said you read them.
There are some that cover this so I wondered which parts of them didnât provide you the answers you needed. Thatâs much easier than us guessing which part of the tutorials confused you and/or writing the whole solution for you.
Note: âI couldnât find the tutorials that covered thisâ is a perfectly valid response⌠but thatâs not quite what you said.
As a beginner, it is really in your best interest to DO all of the tutorials. Donât just glance through the titles and hope for the best. You will learn a lot by going through them for real and they are an extremely valuable resource.
This is what you should have included in your very first post, by the way.
Okay⌠Whatever, so, is there any method in the engine that makes character walk into specific location?
I could give you the lazy answer (basically, attaching a CharacterControl, plus controlling the animation for bonus points), but it may or may not suit your needs.
The problem is that then you will ask how to make a character stop, or jump, or why other weird things are happening; basically wasting everyoneâs time (mostly yours).
Or, you could run all the tutorials (really: all of them!) and find yourself the knowledge to do exactly the stuff you want to do, plus a lot more. Itâs not that we donât want to help you; itâs that if you donât do the tutorials you are doing yourself a big disservice.
Finally, if you are feeling adventurous (and you should!) you can check out my RedMonkey tutorial RedMonkey tutorial
Iâve quick looked tutorials and read half of the book i know how to make character jump and stuff. I just want to know if i can give character location instead of giving it direction.
1°) Create your character. (A spatial ? A node ? What does that mean anywayâŚ)
Spatial ninja = assetManager.loadModel("Models/Ninja/Ninja.mesh.xml");
2°) Set the translation to be at the position you want. ( Why this idiot canât âwalkâ here by himself ! )
ninja.setLocalTranslation(0.0f, 10f, -2.0f);
3°) Copy Pastarino the codo of CharacterControlo and here you go !
(If you want your character to go to a specific location look at normen SDK tutorial he does that with Quixote our savior jME SDK Usecase Demo 1 - YouTube)
No⌠because itâs extremely implementation specific.
Is your game world a physics control world? Does your game world have a walk mesh? Should objects be avoided? What algorithm should be used for path finding? Should the animations change as the player turns?
All of these questions mean that a general solution cannot exist so the engine doesnât include one. Just like there is no âMake MMOâ button. And before you think Iâm being facetious, a âwalk to this locationâ method is closer to a âMake MMOâ button than not when you factor in all that it would have to do and be aware of to be implemented properly.
However, today was released something that could be a good approximation of a âMake RTSâ button
Iâm not saying there has to be. However there is lookat() method, so i simply thought there might be a method like walktothere() or walktowhereyouarelooking()
But whatever youâve said no. So iâm gonna make my own method. Thx for answerâŚ
There is an interpolate method that will help you move from where your character is to a position where it needs to go. You should give it a try.
And that method is?