Skip to main content
GameDev.net gamedev.net
🔒 Locked

Help Please? Collision Issue?

Started by DaniiSnow Feb 23 at 8:37 PM 6 replies 1k views
Original Post
DaniiSnow
DaniiSnow

Hello,

I'm working on a game right now in Unreal Engine where you can pick up and move almost everything, but I'm having an issue where when the player walks over an object / you throw something and it comes back at the character the camera starts shaking and the character will get thrown around/start stuttering. This isn't an every time thing but it's often enough to make me lose sleep. I'm not sure how to fix this, can someone help?

RmbRT
RmbRT

I never used unreal engine, but despite being marketed as noob-friendly, it's actually a tool for experts. If you have no clue what it is doing exactly, then you can't use the engine correctly to pull off anything nontrivial. Maybe start with something simple that has simpler underlying mechanics, and work your way up, and actually try to understand what you're doing. Also, I recommend just learning how to program. Making 2D games without an engine is doable, and gives you lots of insights that using a ready-made engine will never give you, because it hides its internals from you.

But if you want to stick with your project, maybe try the unreal forums or stackoverflow or something. Although I personally can't recommend stackoverflow anymore, I've been treated horribly there and the place is far from what it used to be.

Walk with God.
JoeJ
JoeJ

I have no Unreal exp. either, but it sounds your problem is the player controller is affected from collisions with other rigid bodies you do not want. The following typical options for physics engines are relevant:

Choice of player controller, usually represented with a capsule or cylinder body.
Dynamic controller: Character interacts with other bodies in both ways, which is what you may currently have.
Kinematic controller: Character pushes other bodies out of its way, but other bodies can not push the character.
Idk if UE offers both options and how they are called.

Mass of player body: Eventually you can give it a larger mass, so other bodies have a smaller effect on it.

Collision filter: You simply decide which bodies can collide with which others. Often that's a system of flags or layers.
Disabling the collisions you do not want is probably the easiest option without affecting current behavior otherwise.


DaniiSnow
DaniiSnow

@JoeJ Hi! I ended up figuring it out. Thanks for this though.

Tom Sloper
Tom Sloper

This is a programming question, not a game design question (thus it did not belong in the Game Design forum). Moved to a more appropriate forum. @daniisnow , before you post again, please take a few moments to Browse the forums to identify the proper placement for your topic. And please review our community guidelines before you post again. Good luck with your endeavours, and welcome to gamedev.net.

-- Tom Sloper    --      sloperama.com
taby
taby

UE has amazing fluid dynamics. However, it was too difficult to augment, so I used Claude AI instead to do the coding of the fluid dynamics.

frob
frob

As a guess, you've got your player's pawn configured to respond to physics. From the description when the player's pawn is hit it is trying to respond to the physics impact so it bounces for that, then the position is set manually for the player-driven motion which causes it to look jumpy.

The built in player controller and player are usually pretty good, so you may have changed one of the many defaults in regards to physics.

How you want to handle physics events will vary based on the game. In some games you want player pawns to be fully interacted upon by physics with on actor hit. Sometimes you want to simulate physics so the object interacts but fully lock the position and rotation, allowing the object to move other things but not have the pawn engage in a physics response. Other times you want to unlock one rotation axis so it can rotate but not fall over, and unlock two position axis so it can slide but not leave the ground plane. Other times you want to add a physics constraint component to lock a specific axis so some physics responses happen but they don't knock the player over or bounce it around more than the constraint. You might also set transformations to be world-relative for some types of desired responses.

The physics system is fully-featured so there are many options, since Unreal is designed for large teams making AAA games. There are a tremendous number of knobs and levers that can be adjusted, so it's anybody's guess to which ones you modified to get the behavior you are seeing.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.