Disable component dislocation for a moving actor

Hi,
I am writing a project of driving simulations. I attach box components to the cars to serve as “object detection boxes”. However, when cars make sudden brakes, there will be a dislocation of the box component from the car mesh. Some examples can be seen from the attached videos (red car to the right).

Ideally, I want the box to be just lines staying still to the car mesh.

I have tried to reset the location for the box component with event tick, but it didn’t make any difference.

Please help me with this problem! Thank you!

Could you clarify how you attach them?

Is it the BoxCollision? If so, did you turn off the collision on the box?

Hi, I attached it using the blueprint editor. Add component - box collision and changed the color and shape.

Yes it is the Boxcollision. I have already turned off collision and physics.

So it’s literally this, right:

image

Can we see the entire hierarchy? Also, how do you move the car?


In short: what you’ve described does not happen under regular circumstances. There’s should be no need to tick anything. We now need to figure out what is uncanny about your setup.

Perhaps there are timelines that operate in different tick groups?

The hierarchy is exactly the same as your screenshot. There is no other event involving these collision boxes.

The car with bike is moving along a spline actor. I write down related functions in BP editor by myself. It has no problem.

The other (except the car with bike on it) are from a package called “traffic AI” system. Traffic AI System in Blueprints - UE Marketplace
They are spawned on specific points and follow splines to move. Unlike the car with bike, here everything (except the box that I added) is already prepared in the package. However, I found that these cars sometimes would have sudden brakes/shakes (see the red car to the right) and then the dislocation happens. I think the problem may be solved by either stopping such shaking behavior, or disabling the dislocation. I’ve already emailed the author about this shaking phenomenon and am waiting for a reply.

I honestly cannot think of anything that would produce an effect like you demonstrated unless we actively moved the box in relative space. This just does not happen :expressionless:

Do you ever attempt to move or adjust this box in any way? Its extents perhaps? Anything else?

I changed the size slightly to make it better fit the car model. Nothing else. The cars are moving at a high speed like 50mph (=2235unit/s in UE). The shakings are the only factor that I found related to such dislocation as they happen together spontaneously.

I tried to reset the relative location every tick but that didn’t solve the problem.

How far from the world origin 0,0,0 are you testing this? Can you try it close to the world centre?

This velocity data is retrieved directly through car’s BP functions, not tested outside in the world.

Huh? What is the world location of the car when this happens? Not asking about velocity.

You have an issue with this right?

The car should be enveloped with a box, the box should not be in front of it, right?

  • could you please show the hierarchy of the vehicle
  • explain or, ideally, show how it’s added to the world
  • and tell us roughly the world location of where this happens - I’m thinking it may have something to do with floating point errors but seeing like the other car behaves correctly, I doubt it more and more
  • can you confirm it happens to more cars, just one, all?

Hi,

  1. Please see the BP here. There are several car models (sedan, van, suv etc) all with the same hierarchy. You can see that the box cover the car well.
  2. Random car models (sedan/van/suv etc) will be spawned at each spawning point (the balls on the right bottom corner of the road) every N seconds and drive along the pink path. The white splines there are for my pawn car and the car with bike, which are programmed by me to follow splines.
  3. The location is around (-6610, -15000, 720) here. But this problem also happens in other similar highway maps at different locations, juts not as bad as this one.
  4. Yes it happens to almost all the cars spawned by the traffic AI system. If you look into the opposite direction cars, their boxes are slightly dislocated compared with their initial central positions in the BP. Since the relative speed of the opposite cars are 2x 50mph, they are hard to notice.
1 Like

Thank you for the details. This is super weird and at this point I’d look into what the plugin is doing.

Hey there @ndalien1! This is definitely odd, the plugin may be doing something special on the braking action then, as it shouldn’t matter where the mesh is since this is a child to it. I was thinking floating point precision for a second as well, but if this is still happening much closer to the world origin then that’s not it. You’re not applying any movement to the child itself right?

1 Like

No I’m not applying any movement.
I notice that when cars are moving under a low speed (20mph or 895 unit/s), this problem rarely happen since cars brake smoothly.

Should it be floating point precision, then the car with bike who follows splines and whose BP functions are written by myself should also have this problem. For now I’m thinking about the plugin issue, too but need more suggestions from the developer to debug.

For this post, I am wondering if this problem can be solved by modifying some properties of the collision box.

Hrm, I’d have to have you run more tests before I can get a bead on why this is shifting. Since the box has no collision it can’t be influenced by anything.

Check the relative location of the box and it’s world location and match the world to the parent and verify if the issue is purely visible or if the component’s location is actually shifting. This might help us determine what’s causing it, and maybe be able to find a bandaid. The boxes aren’t physically simulated right?

1 Like

Hi, I record a video of box and car location checking. It seems that the relative location of box and car stays the same whether they’re together or they’re visually apart. They are moving along the X axis and their X locations are always the same. Interestingly, their Z locations went up and down, which should not happen given that the road is even, flat and straight and my pawn car just drive smoothly.

You might need to download the video for a clear view. The location data are showed in the right of the screen.

Alright so that’s a weird one. No local or world shifting whatsoever, so it’s entirely visual and agitated by speed.

It’s kind of acting like it is floating point precision. Could you try out a track that crosses near world center just to see if it’s less pronounced?

Hi,
I actually can not control when it happens and how much it happens. The video in the main post and the last video are recorded on the same road. The cars are spawned by the same starting point.
In the first video, dislocation of the red car happened near (-6610, -15000, z of road) and I put a traffic sign by the road, which you can see in the beginning of the second video.
I will try to relocate this road to pass world center and see how it works.