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 can i switch between Third Person and Top Down in an RTS Game?

Hey, So i want to make a blueprint that attaches a camera to the character i have selected when i press a key. I am working on a RTS game but i wanna test if i can switch between third person and top down view. The problem i am having is that i don't want to do this for a unique character i want to do this for any character that i have selected during game play. But as you all may know in an RTS game there are multiple instances of a single character. So how do you guys propose i do this. I have used toggle and some other methods but to no avail. And i am using the RTSToolkit that is available on the marketplace.

Product Version: UE 4.12
Tags:
more ▼

asked Aug 25 '16 at 03:10 PM in Blueprint Scripting

avatar image

Sarmad36
1 1 3 4

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

2 answers: sort voted first

Hello.

you can add two different cameras to you character BP . one camera in third person position and one somewhere in top

and disable the auto active of one of them.

then your graph activate the second camera and deactivate the other one

camera reference> activate/deactivate

more ▼

answered Aug 25 '16 at 04:24 PM

avatar image

saeedc
2.4k 72 41 105

avatar image saeedc Aug 25 '16 at 04:27 PM

sorry I did not read the entire question first.

if you do not want to do this for a unique character then you can spawn the second character in place of the other one and then possess that by controller.

avatar image saeedc Aug 25 '16 at 04:33 PM

if you have several characters already available and visible in the level you can switch between them using controller > possess/unpossess node

avatar image saeedc Aug 25 '16 at 04:39 PM

like this alt text

possess.png (92.1 kB)
avatar image saeedc Aug 25 '16 at 04:46 PM

and you can possess the character which is selected by mouse or touch if it is a mobile game

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

hi thanx saeedc it worked but not in a way i wanted when tried the above code it placed a new pawn from a class blue print (AI_base template) alt text

what actually i want is:

i have multiple characters at a time as most of the RTS games do have now! when I select a particular character for movement and all other stuff afetr selection when i press the a key the view of the camera should be to Third person view

let me remind all characters belongs to a single class BP (AI_base template) they are stored in an array.

waiting for your response

more ▼

answered Aug 25 '16 at 09:02 PM

avatar image

Sarmad36
1 1 3 4

avatar image saeedc Aug 25 '16 at 09:13 PM

so add a second camera to your character class and activate that when you press X

you need two spring arm and two cameras then.

avatar image saeedc Aug 25 '16 at 09:20 PM

if none of your characters have camera then you need to add a camera to your character class then cast the spawned character to your character class after possess node then get that camera and activate that

avatar image saeedc Aug 25 '16 at 09:22 PM

alt text

lll.png (114.3 kB)
avatar image saeedc Aug 25 '16 at 09:23 PM

and then deactivate the main camera

(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