- 2019-10-30 at 5:29 pm #20867
Hello, everyone. Before going into topic I just want to say I am delighted after 10 years of dreaming to discover a tool like this which allows my photography website to become 3D… I am learning Blender now and I have imported some objects and created my own gallery with photographies as paintings on the wall.
What I want is to be able to override the default W,A,S,D keys in order to have the user smoothly advance through the floor while at the same being unable to pass through objects. For example, I do not want them to be able to climb up the stairs at this momeent or through the sustaining walls or even the floor itself… How could I possibly do that?
I searched through the forum and found ways to retrieve the camera and to set its position upon pressing a key. I even wrote a piece of code for the key ‘W’ and while the console shows it has been pressed the camera still jumps… and tweening animation is not smooth for me, it is too jumpy. Any resources would help besides the manual (and I suppose the book is not yet written).
Thank you very much!2019-10-31 at 10:48 am #20905
Hi, thanks you for your kind words.
To move you camera in character mode, assign the First-person controls for your camera and then use some mesh below it to be a floor. See the city example in our Verge3D distribution (located in applications/city folder).2019-10-31 at 11:59 am #20911
Thank you for your reply! Yes, I have successfully done that. The only issue remains that it will still go through paintings, walls and other materials. I am trying to assign the “Collision material” to more than one object but it did not work somehow, how can I bypass the restriction of having just one collision material?2019-10-31 at 1:06 pm #20915
You can make ‘breaks’ in the floor object near the walls. You could make the floor object separate from the visible floor for this purpose.2019-10-31 at 5:32 pm #20922
@johngrigni : Interesting suggestion. Could you please elaborate a little? From my understanding, I have created a spatial gap between the wall and the floor and added a floor behind the wall, but it would be inefficient to duplicate the floor just to act as a solid object behind the others. I apologize for the misuse of Blender or English if that is the case. I might even share the .blend file or something.2019-10-31 at 5:51 pm #20923
Basically any gap in the floor object is impassable. So if you make cuts in the mesh of the floor object, they can’t walk past the interruption, but they can walk through a door. Or they can walk up a ramp as stairs.
Attachments:You must be logged in to view attached files.2019-11-02 at 1:49 am #20955
I finally get it. I will update this if I was able to do it or not. Very interesting, I would have never expected something like this. According to your drawing, everything should be separated if I want the user to be unable to reach. But the limitation is the empty space itself. The user will see the gray background and lots of gaps I must be forced to fill somehow in order for it not to look ugly… are we sure this is the only way?2019-11-02 at 2:23 am #20956
The actual floor object doesn’t have to be visible. It can be just below the visual floor object, which wouldn’t have any holes2019-11-04 at 10:31 pm #20964
Thank you. I have tried it. I found some interesting stuff. The scene I bought has an interior gallery. Camera does not go through the floor, it is perfect. It goes through walls, but stops after about 1 meter or so… Both the walls and the floor have the same “Floor” material applied with the same variables. I made sure the clip is set to a low value (0.1), I modified the gaze accordingly, made sure the object is also rough and pretty much tried many things I found about Blender on forums, but I got bad luck.
When I add the “Floor” material to other objects for some reason it still goes through though… any other ideas?2019-11-05 at 1:25 pm #20978
I set up a simple scene here:
The folder for it is here:
https://www.dropbox.com/sh/uzgvo1cc6j778ti/AAD0UyOo1iNnpnPAfJL-SPcZa?dl=02019-11-12 at 9:33 pm #21060
This actually seems to do the trick! Just wanted to confirm. Thank you so much !!2019-11-13 at 10:46 am #21066
You must be logged in to reply to this topic.