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"

Moving mesh with camera

I've encountered a problem with a pretty basic thing.

I need to move a large planar mesh with the camera, however the mesh needs to stay world-aligned and needs to snap to a certain grid. Applying a straightforward logic of Getting camera world location->rounding to the grid-> Setting world location for the mesh results in a jittery movement.

In a code, I would simply use late update, but with blueprints I'm frankly stuck. Any clean way of achieving what is required in blueprints only ?

Product Version: UE 4.17
more ▼

asked Jan 16 '18 at 03:54 PM in Blueprint Scripting

avatar image

7.9k 130 31 293

avatar image vr_marco Jan 16 '18 at 04:30 PM

Just a suggestion not having seen your project. Could you use a VLerp (Vector Lerp) to gradually move the large mesh in place so it doesn't jump and snap in place?

avatar image Deathrey Jan 16 '18 at 04:33 PM

Regrettably, it needs to jump instantly.

avatar image vr_marco Jan 16 '18 at 04:41 PM

Could you determine why the movement of the mesh is jittery? Does it lag behind the camera because it doesn't get late updates? Can you apply an moving average filter to the Camera position to smooth out the movement. Or turn it around and disable late updates for the camera? Again, I don't have insights into which UX you are going after so I am just trying to imagine what it could look like.

avatar image Deathrey Jan 16 '18 at 04:52 PM

Yep, that is the cause. Nope, I can't perform anything on camera movement itself. Needs to stay sharp. The movement of my mesh needs to be completely unnoticeable. It is equidistant vertex grid, and it should only be moved by a distance equal to vertex spacing.

Disabling late updates for cam fixes the issue, but that is not a viable option sadly.

avatar image vr_marco Jan 16 '18 at 05:36 PM

Running out of ideas. Last try: what if you parent the mesh directly to the camera and only change its relative position to snap it to the grid and its rotation to keep it world aligned?

avatar image Deathrey Jan 16 '18 at 10:12 PM

Parenting the mesh is fine too, but I gotta add relative rotation to compensate for cam rotation. And that, in its turn, introduces new jitter. And to be fair, snapping to the grid is tied to world position of the camera, so even if the offset is relative, the value is still obtained from world location, one way or another.

avatar image vr_marco Jan 17 '18 at 01:06 PM

Ok.The next thing I can think of is somehow "faking" the alignment of your mesh to the grid by creating a special material with a panner inside or using some form of vertex displacement in the shader. Just brainstorming...

(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