Gate Door open/close animation and Cannon collision issue in "Forgotten Memories".
Author: Jared Barker
Date: March 2, 2023
8:26 PM EST
Xodius Studio Blogs:
Gate Door open/close animation and Cannon collision issue in "Forgotten Memories"
The Problem:
This week, I encountered two problems when working on this project.
- I managed to create the gate door and manage to get it rotating from both sides. However, when I tried to press the E key, one door rotates the z-axis by 90 degrees as it should, but the other rotates in the opposite direction. What the door was supposed to do is to have the right door rotate the z-axis by 90 degrees and the left door rotate the z-axis by -90 degrees. Therefore when interacting with the door, both doors should open at the same time. That's one of the problems I face.
- The other problem I faced is that the cast collider for the cannon trap. The idea was that when the player interacts with the cannon's collision box, it should fire a cannonball (the cannonball was also made from another actor's blueprint) and hit the player. However, whenever the player collides with the collision box, it gave me a casting fail for the cannon. This can be a problem because if the cannon doesn't fire then it won't give the player the feeling of danger, not to mention, causes a lot of issues when trying to test the cannonball's fire.
The Solution:
After debugging and configuring the blueprints, I found the problems.
- For the gate door, I had duplicates of on-collision begin/end components and the E button for the collision. When the E is pressed it confused the bool checks and caused the major issues I mentioned earlier. So what I had to do is make the on-collision begin/end components the main target and check if the player collides with it. If the player is in the collision, then it'll play the open animation for both sides, else, it'll reverse that animation and close both doors. After testing it, the error was resolved
- The similar solution can be applied to the cannon's collision. What I did differently is that I got rid of the cast to the cannon and connect the collision to the spawn cannonball actor. Next, I made sure to set the collision bool, so that if the player collides with the collision box, then it'll set the bool true and fire the cannonball. If the player walks out of the collision, then it'll set that bool to false. Also, I had to get the cannon's barrel to self so that it resolved the casting error.
So overall I managed to fix the errors for the cannon and the gate door and will try to convert them into C++ as much as possible.
Comments
Post a Comment