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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Set velocity reduced on contact with surface

Hello,

I have the following problem: I created an Actor Blueprint with a Sphere within (named "Ball"). By pressing a key, I set the Sphere's physics linear velocity, like this:

alt text

Linear and angular damping are disabled.

When I set the sphere into an empty scene, the sphere moves with the assigned velocity of 20.

However, when I put the sphere on a plane and enable gravity for the sphere, the velocity drops to 14.295 immediately. It will remain constant at this value while rolling along the plane - so I assume it has nothing to do with friction, otherwise it would keep slowing down.

I assume the drop in velocity is due to some physics interaction. What do I need to set, to have the Sphere remain at the velocity of 20 while it touches the plane?

This is the scene: alt text

Also, if I press the key again, the Sphere accelerates but only after hitting the key several times, will it reach the velocity of 20.

Here is an extract of the log for the sphere's velocity:

LogBlueprintUserMessages: [Ball_2] X=20.000 Y=0.000 Z=0.000

LogBlueprintUserMessages: [Ball_2] X=14.295 Y=0.000 Z=0.000

LogBlueprintUserMessages: [Ball_2] X=14.277 Y=0.000 Z=-0.000

LogBlueprintUserMessages: [Ball_2] X=14.286 Y=0.000 Z=0.000

LogBlueprintUserMessages: [Ball_2] X=14.286 Y=0.000 Z=-0.000

LogBlueprintUserMessages: [Ball_2] X=14.286 Y=0.000 Z=0.000

LogBlueprintUserMessages: [Ball_2] X=14.285 Y=0.000 Z=-0.000

LogBlueprintUserMessages: [Ball_2] X=14.285 Y=0.000 Z=0.000

LogBlueprintUserMessages: [Ball_2] X=14.285 Y=0.000 Z=-0.000

LogBlueprintUserMessages: [Ball_2] X=14.285 Y=0.000 Z=0.000

[...] LogBlueprintUserMessages: [Ball_2] X=14.282 Y=0.000 Z=-0.000

LogBlueprintUserMessages: [Ball_2] X=14.282 Y=0.000 Z=0.000

LogBlueprintUserMessages: [Ball_2] X=14.286 Y=0.000 Z=-0.000

LogBlueprintUserMessages: [Ball_2] X=14.286 Y=0.000 Z=0.000

LogBlueprintUserMessages: [Ball_2] X=14.286 Y=0.000 Z=-0.000

LogBlueprintUserMessages: [Ball_2] X=14.286 Y=0.000 Z=0.000

LogBlueprintUserMessages: [Ball_2] X=14.286 Y=0.000 Z=-0.000

LogBlueprintUserMessages: [Ball_2] X=14.285 Y=0.000 Z=0.000

Product Version: UE 4.21
Tags:
ball-blueprint.png (444.9 kB)
scene.png (534.1 kB)
more ▼

asked Dec 26 '18 at 02:53 PM in Blueprint Scripting

avatar image

z1nus
1 1

avatar image SupDeity Dec 27 '18 at 12:05 PM

maybe make the ball do a line trace to see on which surface it is and if it hits the surface u want set the velocity to 20. or maybe just set the velocity using event tick until a condition becomes false. that condition can anything that u can use to stop the ball.

avatar image SupDeity Dec 27 '18 at 12:07 PM

Also im pretty sure its the linear and angular damping slowing the velocity down. it should be in physics section

Try changing the values. and maybe setting it to 0. i havent played around with linear and angular damping a lot.

avatar image Tuerer Dec 27 '18 at 01:17 PM

Why won't you use standard axis input? When you set velocity, it will always rely on physics and friction will do its job.

Or you can try setting a slippery physics material for your actor to eliminate friction.

avatar image z1nus Dec 28 '18 at 10:44 AM

Thank you. That did the trick. Previously, I had only set the plane to a frictionless physics material. Setting both of them to have to the frictionless material did it. What still bothers me though: friction works constantly on a moving body and should therefore keep decelerating the ball until it stops. However, it does not. I tried it out with a very low friction value. The velocity linearly drops from 20 to 19.something and so on until i reaches 14.295. It remains at this value forever, never stopping completely. In fact, I tried this with a few different velocity settings and it seem to decelerate until it reaches a velocity of 5/7 of the initial velocity.

avatar image SupDeity Dec 30 '18 at 08:04 AM

Ue4 doesnt make the object stop its angular momentum overtime. u gotta up the angular damping to something like 3.

  • I know this because of rama.

  • i forgot telling u about physics material. my bad.

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

0 answers: sort voted first
Be the first one to answer this question
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