im fairly new to unreal and coding in general. I have the following Problem: i created a rotating obstacle in my level. When placing it everything looks fine and even starting the game looks fine but i noticed that the collisions feel weird. After checking i saw that the collision mesh did not align with the object itself even though the viewport looks perfectly fine.
it’s a blueprint child class derived from a cpp parent. the obstacles itself are just instances of the mentioned blueprint.
the code for rotation is basically just the “AddActorLocalRotation” function and keep in mind that the object is rotating properly. i just can’t explain why the object and the collision mesh won’t line up.
Almost a year later i got back to coding a little bit and just wanted to update this in case anyone in the future is facing the same issue though i think this will not happen on a regular.
The issue was that the default cube asset from a ue5 learning project had a collision offset defined which had no effect as long as the object remained a cube. after changing it to a cuboid shape it did not align anymore. after removing the offset everything worked perfectly fine.
This topic has been moved from Tutorial & Course Discussions to Programming & Scripting. If you would prefer a different category, feel free to @ me and I’ll move your thread once more.