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"

Set Physics Linear Velocity does not work correctly

I'm using set physics linear velocity to send something in a exact direction with a exact speed so that it will land exactly in the grid but the problem is that Set Physics Linear Velocity is far from exact. It appears it is not a "Set" (Add velocity is off), somehow previous physics velocity affects the Set linear velocity. The only way to make it behave exactly is to first Set all physics simulation off on the body then make a 0.01 delay, then set physics velocity back on again, then do the Set Physics Linear Velocity. With that it goes in the right exact direction and then lands in the grid. But turning physics off and on with a tick inbetween is not a good solution since I will also have to adjust it with Set Velocity every time it collides with something which then can result in some nasty bugs with turning physics off and on.

In case this is not a bug and a limitation of the physics engine Set Physics Linear Velocity should be at least renamed because from a Set I expect it to set the value I set in the Set.

P.S. I'm doing this in Blueprint and I'm not using any physics substepping.

Product Version: UE 4.11
Tags:
more ▼

asked Jun 15 '16 at 11:55 AM in Using UE4

avatar image

Davision
945 104 147 201

avatar image Shohei Aug 05 '16 at 05:51 AM

Not sure if this is relevant information, but PhysX is non-deterministic. You can't use it to get precise, consistent physical interactions. You'd need to use a deterministic physics engine for that like Havok.

avatar image Davision Aug 09 '16 at 04:29 PM

I really wish Epic would have just sticked with Havok, had much less problems with that especially when it comes to funky skeletal ragdoll physics animation. No clue how it works but since it should be a flat set without any influences the non-deterministic part should not be a problem.

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

1 answer: sort voted first

This is still the case, apparently.

"Set the linear velocity of a single body. This should be used cautiously - it may be better to use AddForce or AddImpulse."

https://docs.unrealengine.com/latest/INT/BlueprintAPI/Physics/SetPhysicsLinearVelocity/index.html

Someone had the same issue in Slack, and I was directed here as a result in Google. I love that there are zero comments.

I think you nailed it with: "The only way to make it behave exactly is to first Set all physics simulation off on the body then make a 0.01 delay, then set physics velocity back on again, then do the Set Physics Linear Velocity. With that it goes in the right exact direction and then lands in the grid. But turning physics off and on with a tick inbetween is not a good solution since I will also have to adjust it with Set Velocity every time it collides with something which then can result in some nasty bugs with turning physics off and on."

I thought adding an "Answer" might help get some movement. Also, if this is something that eventually needs work, it might be good to end up in the new bug tracker.

more ▼

answered Aug 05 '16 at 05:15 AM

avatar image

krillin6
123 10 10 17

avatar image Davision Aug 09 '16 at 04:27 PM

I think with cautiously it is referring to performance and if you just do set velocity every frame you could force it through collisions. They probably will never do anything about it because it is all Nvidias PhysX code. Someone of Epic said they put a new version of PhysX in 4.13, hopefully that fixes it but since it is something very fundamental I doubt it and it is just some bad limitation of PhysX.

(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