Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411490 Posts in 69371 Topics- by 58428 Members - Latest Member: shelton786

April 24, 2024, 08:49:34 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)UE4 Help: Splines broke collision in 2.5D sidescroller w/dynamic camera
Pages: [1]
Print
Author Topic: UE4 Help: Splines broke collision in 2.5D sidescroller w/dynamic camera  (Read 2629 times)
Dune
Level 0
**


Hey!


View Profile
« on: January 26, 2020, 07:13:37 PM »

Hi everyone, I'm working on a 2.5D sidescrolling platformer with a dynamic camera (think Klonoa or Kirby 64) in Unreal 4.24.1 and I ran into an issue with splines breaking collision. I'd greatly appreciate it if anyone can offer help or suggestions.

The way it works is I am using the third person UE4 project template, modified the ThirdPersonCharacter (TPC) blueprint to restrict the player to a 2D plane of movement, removed the TPC camera and placed a new camera in the level, added a function in the TPC blueprint that tells the player and the camera to follow a spline path, and placed two spline actors in the level (one for the player's path of movement, and one for the camera path). This is working nicely! But somehow it broke collision, so my player moves right through any objects placed in its path. It can climb inclines or jump on top of objects just fine. If there's a platform at the middle of the player's height and it walks through it, it gets permanently stuck in it (and print function calls show it just stops detecting collision after a few seconds).

Pics are big so I used imgur links, I'm not sure how to get bbcode spoiler tags working...  Shrug

Here is a test run gif showing the camera working during play: https://imgur.com/XuvKw7t

Here's my ThirdPersonCharacter blueprint: https://i.imgur.com/M6iGHWR.jpg

Pics of the collision issues: https://i.imgur.com/ZDVIlhi.jpg

Lastly here's a few more screenshots from the editor: 1 2 3





This is the video tutorial series I followed to set this up. There's a similar setup thread here where people also complain about a collision issue and say it has something to do with the sweep hit result no longer checking for collision. I have very little understanding of what the sweep hit result is or how collision checks work from SetWorldLocation, also I'm fairly new to working with splines, so if anyone could help explain these to me that would really help me out, too. The goal of this project is to build a prototype game level for a class, so I'm doing some early troubleshooting to get my camera and controls working properly in a rough test map.
Logged
Ordnas
Level 10
*****



View Profile WWW
« Reply #1 on: January 29, 2020, 09:59:19 AM »

I should take a look at the code that updates the character location, from what you are describing it seems that the code logic that restricts the character to s 2d plane and to follow a spline is overriding any location setter by the collision.

Can you try to add q condition before the update of the character location, maybe update the location only if a line trace in front of the character do not collide with any obstacles?
Logged

Games:

Dune
Level 0
**


Hey!


View Profile
« Reply #2 on: February 15, 2020, 08:48:03 AM »

Thanks, yeah I think you're right about the issue being that the character location isn't updating properly as the player moves along the spline. Maybe a little too much is going on sequentially for the event tick that there's a delay later on in the function and it throws things off?

I sooort of found a solution, when I checked Sweep on the SetActorLocation, it fixed the collision issue so that now the player character never gets stuck or clips through any objects. Which is fantastic! But I don't think the main issue is inherently fixed because there is still some weird behavior where if the player runs against a wall or object for a while, and then turns away, they sort of zwoooop! quickly move to a new location, like some sort of momentum was built up and then quickly released. It doesn't look or feel natural.



Toggling Teleport on or off doesn't particularly improve or worsen the issue. There are Sweep and Teleport toggles for a few other components that the SetActorLocation feeds into, such as a SetWorldRotation for the camera, but turning Sweep on or off for them hasn't noticeably changed anything.

Quote
Can you try to add q condition before the update of the character location, maybe update the location only if a line trace in front of the character do not collide with any obstacles?

Hmm, I'll keep seeing how I can tweak the function and give this a try and see if it helps. Thanks again for your response!
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic