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. 

Is Overlapping Component works only when the character moves?

I have this third person character blueprint in which I'm trying to hide the character mesh if the CameraVisibilitySphere component overlaps the character. It actually works, but only if the character moves.

If simply I move the character close to an object, rotate the camera so that it collides with the object and gets closer to the character, the mesh won't disappear. But if I just move the character a bit, no matter in what direction and so that the sphere still overlaps with the character, Is Overlapping Component returns true as it should and the mesh is gone.

When the mesh is not visible, without moving the character, and I rotate the camera so that the visibility sphere doesn't overlap anymore, nothing happens. If then I move the character, the mesh reappears.

What should I do to make this work?

Product Version: UE 4.18 Preview
Tags:
blueprint.png (285.6 kB)
more ▼

asked Oct 07 '17 at 03:45 PM in Blueprint Scripting

avatar image

ximera91
67 3 6 11

avatar image ximera91 Oct 08 '17 at 06:07 PM

UPDATE: I also tried using the component begin/end overlap events, but the result remains the same.

avatar image Dune Oct 09 '17 at 10:05 AM

Not entirely sure what you are trying to do here, but the attachment of the object you want to overlap, being attached to the other component seems odd. This is because as the player moves, the object you want to overlap will move with it. The same with if you rotate the camera, the attached collider will rotate, but it will still be attached to the capsule?

avatar image ximera91 Oct 09 '17 at 10:20 AM

I was following a tutorial to make the character mesh disappear when too close to the camera. To make it work, the tutorial guy attached the sphere to the camera, so that when the camera hits an object and gets closer to the player, at closer distances the sphere would overlap with the capsule component and make the mesh disappear. I'm sure there are other ways to do it and the tutorial was a bit old, but I'm still learning and I don't know how to do this otherwise. I asked in a facebook group and another guy noticed the same behaviour, so I guess this is just the wrong solution after all.

And yes, it always remains attached to the capsule.

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

5 answers: sort voted first

Here's an alternative method:

You could try using the distance between the camera and the mesh as the determining factor for whether the mesh is visible or not. You won't have to deal with collision then.

I'll lay out the basics.

• Get the location of the mesh and the location of the camera.

• Subtract the two location vectors and then get the length of that.

• Check if the length (distance) is less than any arbitrary number like 10.

• If it's true, that means your camera is too close and you need to hide your mesh.

Here is the Reddit link to that.Blueprint

more ▼

answered Oct 18 '17 at 04:14 PM

avatar image

ALegendsTale
113 4 9 13

avatar image ximera91 Oct 18 '17 at 04:37 PM

I thought about that too. It may be heavier on performances than the collision method, but atm that won't work apparently, so yours is the best solution. Thank you!

avatar image Noxciss Oct 18 '17 at 04:55 PM

alt text

Based on this, here's what I got. Works for 90% of the model and I'm using the boom location rather than the mesh location. Mesh location is at the base of the model making the behavior less than desireable, but the boom location is in the middle of the chest giving a more centralized bounding sphere.

blueprint.jpg (79.8 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

alt text

This didn't work either, but it did seem to be a step in the right direction? Hidden in the advanced physics portion of each collider is a toggle called "Should Update Physics Volume". This judges which objects movements can trigger an overlap event.

For anyone curious, this is the tutorial we're following: https://www.youtube.com/watch?v=DauWu4AkXak

more ▼

answered Oct 17 '17 at 03:48 PM

avatar image

Noxciss
6 1 3

avatar image ximera91 Oct 17 '17 at 04:21 PM

It didn't work for me either, but I guess it's a step forward at least.

avatar image Noxciss Oct 17 '17 at 04:31 PM

alt text

I'm getting the same results even when using begin and end overlap :/

cameraclip2.jpg (54.5 kB)
avatar image ximera91 Oct 18 '17 at 02:21 PM

Yep, same here. I also added the component by code, but the result is the same. I don't know if this is a bug or simply this cannot be done anymore, but I can't find any documentation about it and there are no other questions on this topic around. I guess we just have to wait for somebody to answer this. It's just frustrating though...I don't think the logic behind this is wrong.

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

Hello everyone, if someone is still having trouble with this, here's the solution.

Go into Mesh, search for Mesh Component Update Flag and change it to Always Tick Pose and Refresh Bones.

Changing this allow to On Begin/End Overlap events to fire even if the Character is not moving.

Cheers

more ▼

answered May 13 '18 at 03:52 PM

avatar image

Cold as Me
6 1

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

Having the same issue, anyone have any answer to this yet? I'm assuming this is a new issue due to a version update.

more ▼

answered Oct 17 '17 at 01:24 PM

avatar image

Noxciss
6 1 3

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

This is old but I hope it helps others as I figured this out recently:

Any component that is attached to the camera is not going to trigger overlaps unless the player moves, so the workaround is to detach it from the camera component and, in the event graph, use a tick to set it's world position to the camera's location. It will then react to any overlap you want, even when the character is not moving. I'm using this to play an underwater sound when the camera gets inside water volumes and show water drops when it comes out.

more ▼

answered May 15 '19 at 12:00 AM

avatar image

Zilaan
6 3

(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