Hello, wonderful people of jmonkeyengine.org.
I am still learning how to use all the features of jme3, and as a practice project, I’m creating a simple first-person obstacle course game. In this obstacle course, there will be platforms that move between two locations, and I have created a custom control, MovingPlatformControl, to dictate the motion of these platforms. My problem is that when I attach both an instance of my custom control and a RigidBodyControl to the platform geometry, RigidBodyControl does something weird. As the platform moves back and forth between (0,0,-20) and (0,0,-40), the RigidBodyControl only collides with the player when the platform is between (0,0,-20) and (0,0,-28ish), even though I’ve made sure that the control is, in fact, moving along with the platform. I am completely clueless as to why the RigidBodyControl is behaving this way, and hope that someone might be able to explain it and offer a solution.
Below are download links to both of the .java files for my project, in case I haven’t made my problem clear enough. Neither of these is a virus, I promise. Use WASD to move, Space to jump, and hold LShift to walk slowly. You will see a black platform in front of you when the game is first started, and it will slowly move away from the player; run over to it and jump on. The player will not move with the platform, so you will have to walk slowly along with the platform to stay on. Attempting to stay on the platform will reveal that at about (0,0,-28), the platform will cease to support the player, and the player will simply fall through it. Parts of the platform that still have z values between -20 and -28ish, however, have normal collision behavior. You’ll see what I mean.
EDIT: I forgot that I used some custom textures, so I’m gonna give you the whole project instead of just the .java files: Dropbox - Error