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 to constantly move camera on x axis?

Hey Guys, In my game, I want to have a camera that is constantly moving forward but can still see the player and then when the player goes off screen they die. What I am stuck with is that I don't know how to make the camera continuously move forward. Any help will be great. Also, I am new to this so you may need to explain thing a bit more for me. Thanks, Ben

Product Version: UE 4.17
Tags:
more ▼

asked Aug 12 '17 at 07:53 AM in Using UE4

avatar image

8-Bit Ben
4 1 2

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

3 answers: sort voted first

You can use PlayerCameraManager for that.

Create your PlayerCameraManager class. Set it in your PlayerController class.

In PlayerCameraManager override function BluprintUpdateCamera. It will update camera every tick.

Now just set new world position to it. For example it can be like:

CameraLocation.X + (GetWorldDeltaSeconds * CameraSpeed)

more ▼

answered Aug 12 '17 at 08:20 AM

avatar image

redbox
2.3k 71 9 78

avatar image 8-Bit Ben Aug 13 '17 at 12:46 AM

Hey Redbox, Thanks for the response but I don't really understand what you![alt text][1] are talking about with PlayerCameraManager class. I forgot to mention in my first post that I have setup a separate camera to be used instead of the stock one in the third person example and I will put a photo of how I set that up. If you could explain a bit more or show some photos that would be great. Thanks, Ben

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

I'm still a bit confused as to the PlayerController class bit but this is what I have done so far and I think I am on the right track, maybe?

progress.png (77.2 kB)
more ▼

answered Aug 13 '17 at 09:41 AM

avatar image

8-Bit Ben
4 1 2

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

alt text

This will add to the actor's current location every delta second. Make sure that when you create "addlocaloffset" that you choose the one that references your already created camera.

movingcamera.png (55.3 kB)
more ▼

answered Aug 13 '17 at 10:50 AM

avatar image

Omnyth
59 1 4 4

avatar image 8-Bit Ben Aug 13 '17 at 11:26 AM

Thanks for the help Omnyth. Just not sure how you connected the delta seconds with the delta location. When I tried I kept getting this. Sorry if it is really simple. I will play around with it a bit.

chase camera.png (56.8 kB)
avatar image Omnyth Aug 13 '17 at 11:35 AM

It is simple, but I can understand why you would be confused just getting into blueprints lol.

Right Click and type "Vector + Float" and attach the green to the green. The upper portion of it "X/Y/Z" will be the amount of translation your actor moves every float amount (delta ticks/second).

avatar image Omnyth Aug 13 '17 at 11:38 AM

If it's confusing I can explain it a bit simpler in terms of just what you need to do. I'm just trying to help you understand the reason behind it :P

avatar image Omnyth Aug 13 '17 at 11:45 AM

Also, you might be better off just attaching the camera to the character, or at least doing this in the character bp. You'll have a bit more control and less difficulty referencing things that way.

avatar image 8-Bit Ben Aug 13 '17 at 12:26 PM

Dude! Thank you so much for the help. Because my camera was at a -45 pitch value the camera was going straight into the ground but then I just added 1 to Z as well and it fixed it. Thanks again!

(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