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"

Solution For Hide my Actor

I am Trying to find solution for hide camera when camera collide with actor so that i can prevent seeing through my actor but it only works when my actor is moving any solution please?

alt text

alt text

Product Version: Not Selected
Tags:
capture.png (101.7 kB)
screenshot-34.png (597.0 kB)
more ▼

asked Jan 22 '19 at 07:12 PM in Using UE4

avatar image

rahman1154
1 1

avatar image the_batch Jan 22 '19 at 07:31 PM

You want to hide your camera component? I don't understand, and I'm not sure that makes sense, since the camera itself is not ever visible in the first place.

Let's start over. When your camera gets too close, like in your second screenshot, what do you want to see happen?

avatar image rahman1154 Jan 22 '19 at 08:32 PM

alt text

i want my mesh hide so that user can not see through it's body

screenshot-36.png (314.9 kB)
avatar image the_batch Jan 22 '19 at 09:44 PM

Now I get it. Thanks. I'll post an answer shortly.

avatar image rahman1154 Jan 24 '19 at 11:39 AM

thanks appreciated

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

2 answers: sort voted first

I think the reason your approach wasn't working has to do with the collision profiles of your character's mesh and that of your sphere collider. It might be tricky to find a combination that allows for an overlap to occur without negatively affecting the character's typical collision behavior.

So, instead of going about it that way, I found two solutions that worked using other techniques. Have a look:

Approach One - Square Distance

The screenshot above shows the first way I solved the problem using a very inexpensive squared-distance comparison. Using this approach, you specify the closest distance the camera is allowed to be to the camera's orbit point (the end of the camera boom), and if the camera gets closer than that distance, the character is hidden. The drawback of this approach is that it might be impossible to find a value that works satisfactorily for all viewing directions. I noticed that a distance of 80 units worked well for hiding the character when the camera was approaching from the side, but it didn't work as well when the camera approached from the bottom. You could probably interpolate between a couple of values using the camera's rotation to improve this technique somewhat, but it would never be "perfect", though it might be "good enough" for most situations.

Here's my other approach:

Approach Two - Collider Check

This second approach is effectively the same as what you were trying to accomplish, but thankfully it works without having to worry about collision profiles. It takes advantage of the Get Closest Point on Collision node, which helpfully returns 0 if the provided point is within the collider. So if the return value is exactly equal to zero, the character's mesh is hidden. The downside of this approach is that it's not as beautifully inexpensive as the first approach, because it presumably relies on line traces, but this isn't a problem if you're not extremely concerned about optimizing your game. Besides, the upside is, it works from all directions, unlike Approach 1.

Hopefully one or both of those solutions helps you out and gets you closer to your goal. Let me know if I can help explain things any better!

more ▼

answered Jan 23 '19 at 01:20 AM

avatar image

the_batch
1.2k 4 5 8

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

This one should help https://www.youtube.com/watch?v=Wm21RRSQ-sg Instead of using Capsule colliding with Camera, you can make it check colliding with mesh itself, if you tick "Generate Overlap Events" in the mesh

more ▼

answered Mar 05 '19 at 12:22 AM

avatar image

Lokosia
1 1

(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