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"

How do you make something always rotate away from a surface normal?

I want to tilt the camera away from the wall in the direction you're touching against it. How do I do that?

I've set it up so when the character hits an actor tagged as wall it gets the surface normal, and hit location but I can't figure out what to do from there.

I tried using the hit location and a component placed on one side to get the distance between the two but that all goes out the window if the character is closer to directly facing the wall or with his/her back to the wall.

Product Version: UE 4.18
Tags:
more ▼

asked Jan 23 '18 at 07:27 PM in Blueprint Scripting

avatar image

0vr
182 21 32 40

avatar image 0vr Jan 23 '18 at 07:39 PM

I was thinking of using line traces in each direction or trigger components placed on each side of the character but isn't there a mathematical way to do this? the line traces idea especially seems expensive

avatar image MisunderstoodS Jan 23 '18 at 07:45 PM

Are you using blueprints or c++

avatar image 0vr Jan 23 '18 at 08:02 PM

blueprints

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

1 answer: sort voted first

So if I understand your question correctly you want to rotate the camera away from a wall when you physically run agains it. Your trace idea isn't that bad but is pretty expensive as you said so I would recommend to add a collision component like a sphere or something and then add an event on it (OnComponentBegin/EndOverlap) and then do this: alt text Note that you need to make sure that the wall can be ovelaped alt text

changecamrot.png (151.0 kB)
collision.png (24.4 kB)
more ▼

answered Jan 23 '18 at 09:01 PM

avatar image

MisunderstoodS
1 1 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