Give speed to spatial

hi, i’m a begginer, how to give speed to my spatial.

Poke it with a stick till it moves

It seems like you are misinterpreting something, could you please either:

  1. read the wiki tutorials (link at the top of this page) or…
  2. specify what exactly you want (a spatial does not have speed) or…
  3. post some code to explain the issue
3 Likes

https://www.mikeash.com/getting_answers.html

1 Like

Some very interesting reading relating to your endevour.

http://natureofcode.com/book/chapter-1-vectors/
http://natureofcode.com/book/chapter-2-forces/

1 Like

If you want to do it with Physics look here: https://jmonkeyengine.github.io/wiki/jme3/beginner/hello_physics.html

If you don’t care about Physics and just want to move things look here: https://jmonkeyengine.github.io/wiki/jme3/beginner/hello_main_event_loop.html

Note the second one does “rotation” but I’m sure if you look through the other actions you can do on the player object you might be able to pick the right one (COUGH COUGH translation COUGH)

2 Likes

To attach user-defined information (such as speed or velocity) to a Spatial, one solution would be the Spatial.setUserData() method. To update the position of a Spatial on every frame, use a custom scene-graph control or an app state.

Or you could use the Bullet physics library that’s integrated into JME.

1 Like

thanks to everyone. sorry i dont want to reply because my english is bad,i just give love :smiley:

3 Likes

Don’t worry about it, there are many people on here who do not speak English as a first language. Welcome to the forums. :slight_smile:

3 Likes

https://jmonkeyengine.github.io/wiki/jme3.html#controlling-game-logic

Video

code
https://jmonkeyengine.github.io/wiki/jme3/advanced/sourcecode.html

2 Likes