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 I lock the camera?

Hello,

I am making a Side Scroller game using the template and the default character, I have put some BP so the pawn moves in a direction at all times and if the player presses the letter A the direction changed from right to left. When this happens the camera is also rotating which I do not want.

I need the camera to follow the player but when the player changed direction I do not want the camera to do the same.

Any ideas how to fix this?

Thanks.

Product Version: UE 4.14
Tags:
more ▼

asked Dec 30 '16 at 10:46 PM in Blueprint Scripting

avatar image

Tommow
15 13 17 18

avatar image Looniper Dec 30 '16 at 11:04 PM

Could you show what you have taking place when you trigger a direction change?

avatar image Tommow Dec 30 '16 at 11:10 PM

alt text

movement bp.png (300.7 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

I don't see why the camera would be effected if you're using the SS template.

Maybe try changing from reversing the Input feed to feeding in 1 either way.. But reversing the direction normal.

0, -1, 0 one way 0, 1, 0 the other


alt text

reversion.jpg (92.7 kB)
more ▼

answered Dec 30 '16 at 11:15 PM

avatar image

Looniper
766 22 7 36

avatar image Tommow Dec 30 '16 at 11:21 PM

Hi, could you explain a little more what you mean as I am new to ue4 and development in general, I understand the world direction is the issue here but unsure how to fix it :)

avatar image Looniper Dec 30 '16 at 11:26 PM

Using the keys you are using.. it would be like this. (this may not fix the problem)

alt text

revisionsa_d.jpg (73.6 kB)
avatar image Tommow Dec 30 '16 at 11:29 PM

I have tried the other method with having the world direction changing but not the scale value as shown in the previous screenshot but the camera still flips when I change direction :(

avatar image Looniper Dec 31 '16 at 12:00 AM

Wait.. I think I have been misunderstanding.

I thought you were saying the camera reversed when the player does - moving to the other side.

Are you saying you want the camera to continue moving Right when the player goes Left?

avatar image Tommow Dec 31 '16 at 12:04 AM

I want the camera to follow the player at all times which it does, but when I change the direction of the player the camera spins 180 degrees. I just want the camera like every other game in this genre basically :D

avatar image Looniper Dec 31 '16 at 12:15 AM

Okay, sometimes it is so obvious it is hard to notice...

Click on the Spring Arm and change the Rotation to World(Absolute)

World rotation

absrot.jpg (23.7 kB)
avatar image Tommow Dec 31 '16 at 12:21 AM

I have changed it from relative to world and it now looks like your screenshot but unfortunately the camera still flips 180 degrees when I change the player direction.

avatar image Looniper Dec 31 '16 at 12:25 AM

I'll keep digging.. changing the arm to Relative was how I got it to start turning the camera with the character.

I'll see if I can find other things that will do it too.

avatar image Looniper Dec 31 '16 at 12:43 AM

I took out the Spring Arm and it started swinging 180degrees with the character changing directions.

After I replaced the Arm's settings with this it worked again.

Correct SpringArm Settings

armsettings.jpg (41.7 kB)
avatar image Tommow Dec 31 '16 at 12:26 AM

I have changed it on the spring arm. and it is set to -90 degrees so the camera is right where I want it. But when I press D and move left instead of right the camera flips :(

avatar image Tommow Dec 31 '16 at 12:44 AM

I have just started a brand new project and for some odd reason my camera is working fine. Even though I have the exact same BP setup. So if you have any further things just in case it breaks in the future then I would still appreciate some help.

But for the moment it is working, the only difference is the spring arm and camera I placed manually but in the new project I have not touched them, the settings were the same though so I am still unsure how one works but not the other.

Thanks for all the help :D

avatar image Looniper Dec 31 '16 at 01:08 AM

Good luck with the project.

I don't think I was much help. ;)

(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