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"

Rotate camera if player is about to go out of its view?

How can i check if my character is inside my camera view or not ? so that i can move/rotate camera before its about to get out of its view? i only want to rotate camera if "character" is about to go out of view. not after it gets out of view?

Any clue would be very helpful. cuz i have no idea how can i do that..

thanks!!

alt text

Product Version: Not Selected
Tags:
untitled-1.jpg (49.3 kB)
more ▼

asked Apr 17 '15 at 02:32 PM in Blueprint Scripting

avatar image

VeerChidar
143 30 33 94

avatar image VeerChidar Apr 20 '15 at 05:06 AM

I tried attaching a box on the left and the right side of camera to get event overlap to rotate camera. but its not working as i wanted.. its been two days and i am stuck... please help!!

avatar image VeerChidar Apr 24 '15 at 09:48 AM

c'mon anyone ?? its been 6 days now..

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

2 answers: sort voted first

No one answers because the answer is too simple and only requires math education. Get the rotation vector and rotate if the vectors mins/maxs are out of the desired bounds.

With blueprints its simply use the (Not Equal) node: http://img.ctrlv.in/img/15/04/24/553a3189163d1.png

Here is my full blueprint which tells you if an actor is out of the camera's bounds:

http://img.ctrlv.in/img/15/04/24/553a310d65c52.png

Also you have to use the Set Control Rotation node to set the rotation or your character won't move? But it depends on your setup!

more ▼

answered Apr 24 '15 at 10:29 AM

avatar image

Azarus
1.9k 60 50 189

avatar image VeerChidar Apr 24 '15 at 11:42 AM

thanks! but how would i do that.. can you explain in details ??

avatar image Azarus Apr 24 '15 at 12:04 PM

I updated my answer.

avatar image VeerChidar Apr 25 '15 at 12:47 AM

You are genius.. thank alot :)

avatar image VeerChidar Apr 25 '15 at 01:12 AM

one question though... how would i know that my player is going out of the camera view toward the left or the right? its giving false on both side right now i dont know which direction to rotate my camera because of that?

avatar image VeerChidar Apr 25 '15 at 01:26 AM

alright i figured! i just had to check if "find look at rotation" Y rot rotation was positive or negative..!! :)

avatar image VeerChidar Apr 25 '15 at 08:09 AM

hmm.. it worked in first time and after changing rotation of camera its not working.. what would be the right way to do this?

avatar image Azarus Apr 25 '15 at 10:36 AM

You don't have to know which direction: left or right. You have to know the rotation. And you know it, just rotate your camera using the output rotator, the one calculated from the 2 points.

avatar image VeerChidar Apr 25 '15 at 11:10 AM

yup worked! i thought i'll have to rotate camera manually by some degree.. but now its much easier after doing what you said. thanks again for your clean and clear replies :)

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

An another possbile solution is to use: ConvertWorldToScreenLocation

http://img.ctrlv.in/img/15/04/24/553a87c9c433b.png

more ▼

answered Apr 24 '15 at 06:13 PM

avatar image

Azarus
1.9k 60 50 189

avatar image VeerChidar Apr 25 '15 at 12:54 AM

thanks, i'll try to work with this one as well.

(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