V0.0.3 Devlog - LH


"Collision Nightmares"

Author: Liam Hans

Posted on: 06/27/24

THE PROBLEM

This week, one problem I was tasked in solving was creating more of a "starting" feel to our game, as previously we just had our player spawn into the level and begin playing. To simulate a more authentic start, I had our player begin outside of the arena and walk through a gate into the arena. As our player approaches the gate, it would trigger to open, and as he nears the center of the arena, it triggers to close and the game begins. Pretty simple, right? Yeah, that's what I thought. For some reason, I had an absolute nightmare with this seemingly menial task, as my collision volumes were not behaving at all like they were supposed to, particularly, the collision box that was supposed to block the player from entering back into the stairwell after the door has begun closing. I originally attempted to place a box collider at the front of the gate, and then set it active when the player triggers the door to close. This worked, but only about 50% of the time. Why that happened, I have absolutely no idea. So, I had to figure out a different solution. Below you can see an example of the problem, as well as an image of my attempted solution in blueprint.



THE SOLUTION

Because setting the door block scene component as inactive/active did not seem to be working for me for whatever reason, I was forced to find an alternate solution. It seemed to me that attempting to manipulate a scene component after it had already spawned was causing me issues, so I thought, why not just spawn something in? And that's exactly what I did. I created an actor blueprint called BP_DoorBlock that only had a single Collision component on it, and I spawned that actor into my scene at the moment our player hit the close door trigger. Although this is not the most creative solution to the problem, in my opinion, it does the job and does not affect performance. Below you can see an example of the solution I implemented, as well as how it was done in blueprint.

Leave a comment

Log in with itch.io to leave a comment.