Crystal Cavern - Weird behaviour when scaling ball during runtime

Hey.

I’m almost done with Crystal Cavern and like to add some functionality like powerups.
I already achieved it for a speed boost.

But I’m having issue with a scale change.
First I did the change of scale immediately and my ball flew around like crazy.
I know this is due to physics and related to the same isssue we had in MarbleRun.
So I use a “Timeline” to increase the size over time (1 second).
This (on its own) works like a charm → No flying ball :slight_smile:

But as soon as my player ball picks the item up it somewhat behaves weird in movement.
I can’t really control it. It is wobbling around it’s current position.
It feels as if 1 point of the ball is heavier than the rest.

This is my code to change the size of my player. After a delay it will be reset.


The Static Mesh is the root component of my Player_Pawn

This is the weird behaviour. Please note I’m not pressing any buttons.
GIF 11.06.2021 08-26-02

As soon as the scale is reset everything works ok. So I assume it’s related to scaling physics objects but I don’t know what/why.

If you need any more information to possibly know whats going on, please let me know and I’ll provide it.

Any help/advice is much appreciated.

Hi there!

This was actually a fun little bug to solve. Here’s why it’s happening on how I solved it on my end…

This is happening because of the pivot point of the sphere mesh that’s used, which sits at the bottom of the sphere instead of at the center which would be expected. Scaling physics objects mucks with both the pivot point and collision calculations.

Solving this is as simple as changing to a sphere mesh that has the pivot point in the center, I used the MaterialSphere mesh that is part of the starter content for UE4.

1 Like

Thank you very much.
I wasn’t aware of the fact that the pivot of my sphere was not in the center.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms