3D Game Development

11/03/2020

I make our game based on this tutorial series E01-E03.

From the tutorial, the character can only be controlled by mouse for movement, interact and camera control. I modify the code to enable keyboard to control the character. However, user can only choose one of them on setting page.

There is some difficulties I faced on adding keyboard control:

1. Character moving direction will not update with camera facing

Character move according to its direction, not related to camera

Player input “W"/"Up arrow" after camera rotated

Solution:

Multiple the rotation of y-axis on character movement

Player input “W"/"Up arrow" after camera rotated

2. Player cannot interact with the object

Solution:

3. Character no response after interact with the object

Actually, it is bring from the solution of difficulty 2.

Solution:

Don’t call the playerController SetFocus function.

4. Player hard to select the object that they want to interact with

Solution:

Use a list to store the triggered object > Add object into the list if player is around the interactable object/Remove object from the list if player leave the interactable object > Compare the distance between the player and the triggered object > Highlight the object that near the player

Other problems:

1. Character model go away from the parent object when animated

character go away from the cylinder

Solution:

Export animation from Mixamo with “In-place" is ticked.

發表留言