I’m kind of new to jmonkey but I’ve done all the 13 first beginner tutorials but I’m still wondering something.
In my game, I want a character which is suppose to collect stuff to get points. In the same way Sonic collects the gold rings. So I want to put the stuff (which is suppose to be collected) into the terrain in the scene composer, which is not a problem.
The problem is that I do not know how to make them disapperar when the character “walks into them”. Should they have some kind of physics like rigidbody och charactercontrol or what should I do?
Oh I thought I linked the other wiki page about collisions using Collidable with bounding boxes etc. as the OP mention he’d already gone through all the tutorials and this is a bit of an advanced extra topic
Or if the object are simple enough and you don’t acutally need any fancy collision (like the coins in mario or something like that) and your character should be able to walk through them, you could simply check the distance of the player position to the coin position.
No I haven’t yet, only the beginner tutorials. But I use a tree (included in testdata) for testing so I add the tree in the scene composer. And when I do that, I can collide with the tree. But I don’t want the tree to be a “physical object” (Like it wasn’t there, since I want my character to be able to just walk right into the object, and then it will disappear. Of course I will use something else than tree but i need something to test on
Of cource that’s is one idea! But if I go with that, do I need to loop through all the “collectable objects” and check the distance in the update loop?
Ok. But now when I added the tree from the jme3testdata package, I can collide with it. I added it from the scene explorer so I didn’t add any physics to it myself, did Jmonkey do it automatically? How do I remove it?
One more question, what is a “fancier” way of doing collision test with objects like the “gold rings” in Sonic?
Haha okey But how do I remove the physics from an object I added in from the scene explorer? I know how to access it in code but I don’t know what to do from here. How could I achieve the same as in Sonic without checking the distance? Is there a fancier way?
In my scene explorer I have a node. Inside the node I have the terrain, the TREE, and ambient light.
I create a rigidbodycontrol for the scene when i load it, and then I also collide with the tree.
I think I will go with that. But still, can I detect collision in another way than looping through all the objects in the update loop and checking the distance?