Character Model Visible on FPS
Asked Answered
A

8

0

You know when there are games that allow you to see your own feet when you look down, or overall just see your character? Is there a way to make this into my game, properly? because, i try and try and i make little to no progress, i tried using a logic where the mesh of the character follows the same rotation in Y axis as the Camera or the Neck and still, i get insufficient results, either it doesn't follow properly and/or the movement is completely bugged. Is there a code or trick to make this happen?

Actinouranium answered 21/1 at 23:51 Comment(0)
K
1

As far as I know games usually have seperate models for the first person view.
Those models only have arms and in some games body and legs.

When you look you rotate your whole character in fps games. And if the first person mesh/rig is a child of it, it would rotate and move with the player.

[ EDIT: The arms are most of the time children of the camera (which is a child of your character). So when you look around you always see them.]

You just need to change the animation on your arms and legs.

Here is a short video where you can see how someone sets this up in unreal engine (haven't found anything better for now):

What do you mean by overall see your character? Like third person?

Kor answered 22/1 at 8:10 Comment(0)
M
1

Actinouranium You know when there are games that allow you to see your own feet when you look down, or overall just see your character?

There are.

Kor As far as I know games usually have seperate models for the first person view.

This is the best way, because due to the proximity to the camera, the character model should have increased detail and textures that are redundant for the 3rd-person view.

Those models only have arms and in some games body and legs.

The main thing is to keep the character away from the mirror. ๐Ÿ˜น

You can see how this is implemented in the free game. With most of the resulting problems. The game with adult content! Switch to 1st-person view โ€” Alt + V.

Made answered 22/1 at 12:25 Comment(0)
A
0

Kor well, i will try to make the character model a child of the camera, i don't know why i never thought of that, but i will try now different approaches. But wouldn't the character model rotate in the x and z axis also? so like, if the camera points up the whole character model points up also? best would be if it only rotated in the y axis following the camera

Actinouranium answered 23/1 at 0:49 Comment(0)
K
0

Actinouranium Yes you are right. Only the arms and weapons should be a child of the camera. I once found a nice video about creating first person arms but I couldn't find it now.

The body should be a child of your player and not the camera, so it only rotates when you look left and right/ rotate the player.

This is one of the things why I think gamedev is so hard (well at least for me). It's so much work when wanting to create something nice, like having arms or legs. ๐Ÿ˜Ÿ

Kor answered 23/1 at 12:29 Comment(0)
A
0

Kor and something so simple also, it isn't bonkers crazy to make your player see its own legs, but somehow it is ๐Ÿ™

and i don't know if making the character model child of the characterbody 3D (player) because i'm almost sure that i have tried that and it didn't work as planned, but i will try it again and some other things and see how it works

Actinouranium answered 24/1 at 0:23 Comment(0)
G
0

Actinouranium you are doing it all wrong.
First, no, it's not simple. Back in the day games didn't show your legs.

1 - A first person model MUST use different animations than a third person one. Try looking for first person animation from AAA games to see what they look like. A good start is Mirror's edge, there was a video showcasing the player animations. As far as I'm aware, you HAVE to create these yourself, animate the character while looking at it from the camera.
2 - The character must be in separate meshes, Mirror's Edge could be the exception since you don't use guns (I think). Look at CS animations, or from any FPS. The arms and the gun are it's own object, the camera comes from the chest and they are positioned around it.
3 - I don't know what your character code looks like, but the camera must be parented or follow the Character3D, so when you rotate in Y the arms and legs and camera follow the Character3D. There must be a Node3D at the center and the arms and camera must follow it. Like this:

 Character3D (rotates in Y)
    |
    |->Node3D (rotates in Z)
    |   |->Arms
    |   |->Camera
    |
    |->Legs

The problem with using a complete character is that the camera will clip through it and look all wrong, specially the head and chest, this is because these move all the time.
Some really bad unity tutorials would tell you to put the camera in front of the face. This is a bad idea. It leads to either an unstable and nauseating camera, or excessive clipping.

4 - Finally, play around with camera near distance and change your visibility layers. There must be ONE layer that's not visible to the First person camera, and one that is ONLY visible to the First person camera.
Lets call the first one "Third person". You put here things that the First person camera should not see. You can put a fully animated third person character here, so it can be seen in mirrors. It can also maybe be used to cast shadows.
We'll call the second "First person". Only the arms and legs will be in here. this way you don't see the shadow of your two floating arms, and they don't show up in other cameras.

Guadiana answered 24/1 at 15:38 Comment(0)
A
0

Guadiana Actually, you helped me a lot with the logic, i'm very glad you could help with understanding it. I will try what you just told me, search for some other things and then i will come back with the results.

I actually thought it was simple lol but you made me realize that some things in gamedev that appears basic actually are more complex than they seen

Actinouranium answered 25/1 at 0:23 Comment(0)
A
0

Guadiana
Sorry for taking so long, managed to solve this out a couple days ago but was focused on shooting mechanics. It was actually quite simple, but at the same time i got a little frustrated because it was actually so so simple lol

basically, as you can see down there with "O_Mensageiro_game" that is actually the 3D model of the player, i just had to parent it to the Node "Head" and...that was it, the model was following the camera without errors. Atleast i was very satisfied with the results so i came to an end there, but maybe i will try something different in the future

Actinouranium answered 30/1 at 0:55 Comment(0)

© 2022 - 2024 โ€” McMap. All rights reserved.