x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Applying physics force and rotating actor simultaneously causing strange movement

Background:
When developing a game to have a physics enabled rocket actor orbit around a fixed planet I ran into an issue with physics acting strangely when the rockets rotation was being set at the same time that the planet was applying a gravity force to the rocket. I narrowed the issue to the actor having a simultaneous physics force applied and rotation being set.

Reproducing Bug:
1. Create default project.
2. Add a new actor blueprint to the project and add a mesh component to the actor blueprint. (I used a cube)
3. Set the new actor to have physics enabled and gravity disabled. With or without gravity the issue persists.
4. Add a new actor-component blueprint to the project which will add force to the physics enabled actor. I have attached the text of my blueprint for AddForce.
5. Add a new actor-component blueprint to the project which will rotate the actor. I have also attached the text of my blueprint for RotateActor.
6. Add the AddForce and RotateActor blueprints as components of the actor.
7. Run the project in editor mode. The actor mesh will rotate correctly and the actor velocity will be calculated correctly but the position of the actor will update in an irregular fashion.
8. NOTE: If using my AddForce and RotateActor blueprints, add a tag to the actor named Mesh so that these blueprints can get the primitive component of the mesh

If needed I can provide a zip of the project file.

Information:
Issue occurs in Unreal Engine 4.16.3 on Windows 10.

Product Version: UE 4.16
Tags:
more ▼

asked Aug 04 '17 at 05:45 PM in Bug Reports

avatar image

BimmyBimmy
36 1 6 6

avatar image Matthew J Aug 30 '17 at 02:04 PM

Hello BimmyBimmy,

The zip file you uploaded seems to be empty, at least from what I see. Could you upload a zip of the project itself for quicker testing?

avatar image BimmyBimmy Aug 31 '17 at 06:53 PM

Hi Matthew, my apologies for the original zip being empty! I've put together an example project that better illustrates the issue and attached it here. In this project I have set five actor cubes with physics enabled and gravity disabled to have a force applied to them in the positive x direction and to add a local actor rotation. I have used different methods to apply the force and to rotate each actor. The results from this testing are as follows:

  • Actors with physics enabled and with scene components cannot be rotated by any AddRotation function, whether it targets the actor or the scene component, or if the rotation is local, relative, or world based. I assume this is intended functionality as with physics disabled, AddActorLocalRotation works as expected.

  • Actors without scene component and with force and rotation added by actor components update position in a very irregular fashion.

  • Actors instantiated as a default static mesh cube without a scene component and with force and rotation set by actor components update position and rotation nearly correctly, however they move slightly slower than an actor instantiated from blueprint, whether the blueprint instantiated actor has a scene component or not, or if the force of the blueprint instantiated actor is applied by a function in the event graph or by an actor component.

  • Actors without scene components and with force and rotation added by functions in event graph update position and rotation as expected.

Notes: Best practice with this use case is probably to set the rotation of the actor as a physics angular velocity rather than adding a local rotation to the actor every tick. As well, I am uncertain whether it is best practice to have an actor with its root as a mesh (e.g. without a scene component) as this is the only case where the issues can occur.

Thank you for your time!

link text

bugreportproj.zip (630.4 kB)
avatar image mxnko Mar 12 '18 at 06:44 PM

Experiencing this problem as well.

avatar image ELKatlan Mar 26 '18 at 09:29 PM

Also experiencing this issue. I was applying forces with AddForce every Tick. But the moment I added a .SetActorRotation() in order to make them face their velocity, the simulation broke. It only worked when the framerate was low enough for substepping to occur, if that gives anyone more information to look into. Very odd, but regardless, I'm going to try AddTorque instead since I suppose it's a bit odd to set rotation directly of a simulating actor. Epic please fix!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hello BimmyBimmy,

I apologize for the delay but thank you for providing the reproduction project. I've taken a look and entered a bug report for this which you can find here: UE-52519 You can follow that link for any updates to the bug report, but as this issue has been around for a while, it will likely not be prioritized or fixed soon.

Have a nice day!

more ▼

answered Nov 17 '17 at 05:28 PM

avatar image ELKatlan Apr 09 '18 at 05:16 AM

Hey Matthew, Thanks for registering this bug! Am I reading this right though? It's already been marked as "Won't Fix"? There's no explanation either or response. Seems like a pretty big bug to me, or at least one that deserves some response or reasoning. Any details? Thanks!

avatar image Matthew J May 01 '18 at 04:34 PM

Hello ELKatlan,

I checked the comments on the bug report itself and added a public note to the public report to give an explanation. It was decided by the developer in charge of that area that we will not allocating resources to fixing this. The comment I provided was "We will not have a chance to dig into this. My guess is it is related to forces being added in different orders, and the 'set rotation' cancelling out velocity (being treated as a teleport)"

It may be possible to work around this by ensuring that the velocity is kept after set rotation. Unfortunately I'm not sure how else to assist.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question