[TUTORIAL] Smash Bros-style multiplayer camera system (blueprints)

I follow the tutorial! Works perfect in 4.8.3.

Glad to hear it ! Thanks for the feedback!

Hi i’m not sure why but i keep coming up with a lot of errors.
i have followed the tutorial exactly but when i press play it spawns a third character that just falls out of my level when i remove the camera blueprint out of the level it doesn’t do it and i was getting errors set its not set the actor location or the distance. when you make the reference variable for you character what variable do you use? it looks like its just not connecting with my characters, i am still new to this and it’s just for the sake of getting more use to it. i think i just have set up my characters in the wrong type of blueprints or used the wrong variables for the reference. if anyone can explain i which ones are the correct ones would be a great help. thank you in advance

Hey there,

i didn’t look at the whole tutorial but i noticed that you do this stuff:

&d=1429292232

The C1,C2,C3,C4 Variables are Pointers. If you use them in the Tick, you need to check if they aren’t empty!

Some of your viewers talk about the “Accessed None” error. That happens because the variables are empty while the tick tries to
access them. Please make use of the “IsValid” node (not the one with the Bool return).

Go through your whole project and make sure the Pointers are valid and if you can’t make sure that they are valid, use the “IsValid”
node to prevent them from being accessed although there is nothing in them (:

Hello thedon2k! Thanks for the questions. The variables are character references derived from the “Get All Actors Of Class” node. If you have that node there, your variables should be okay. Could you post a couple of images of your event graph? I’d love to help more but it’s hard to figure out what the problem is without more information.

Thanks for the feedback eXi! I’ve actually made quite a few changes since the original draft, with your suggestion being one of them. In fact, that entire mess in the screenshot you posted is completely out of the picture at this point. You can see in edit 4 that the isValid node is checking every time Unreal resets the character array. I’ve been meaning to go through the walkthrough and incorporate my edits and the changes I’ve made since so it’s up to date, but I haven’t been able to find the time recently. I’ll get to it as soon as possible so as not to cause any more confusion. Thanks again!

I know this is old but I get an issue when it’s checking the branchs for the Distance index. It gets stuck on the empty False exec for Func 3-4 when one of my characters die and respawn. It can’t tell the distance between the new character and the one still on the stage or maybe its failing to add the new character to the players array. Any ideas?

EDIT: When printing my Index to screen It starts at 1 for 2 players and when a character dies it goes to 0 which causes all the branches to fail

Hi Prazon! I think you guessed right: It sounds like the Players array isn’t adding the new character. The best way I found to deal with this is to set a custom event that triggers when you respawn a character which will clear the Players array and run the exec back through the creation of the array, starting with the “Get All Actors of Class” node. This should reset the array with the new character included.

First off I wanted to share a massive thanks for your work, , and everyone else that has contributed to this; I’d made a few attempts at a camera system in this style but repeatedly fell short until I found this.

In editing the blueprints to fit my needs I may have found a method of compacting the series of Branches that test the “Index of Max Value” from the float array that I wanted to share!

First step: Same as the original, create an array of all players in the level.

Second step: Iterate through the array of players and fill a second array of vectors.

Third step: “Minimum Area Rectangle” is the key here. Plug the vector array into it as well the current location of the camera. “Out Rect Center” should be the equivalent of finding the mid-point between the two most distant players. The outputs for “Side Length X” and “Side Length Y” could be used to solve an easy Pythagoras equation. This would provide the float value for the distance between the two most distant players and used to set the Target Arm Length.

Hopefully this is all formatted correctly and images show up; first time poster so excuse any mistakes!

@anonymous_user_516af303

Thanks for the idea with the “Minimum Area Rectangle”. If you use this approach however, you have to make sure that you really have atleast 4 players. I hit my head against the wall yesterday for about an hour till I realized that this function can not work with less than 4 points to calculate a rectangle (hence my “can’t invert nil matrix” errors). So I guess it would be best to check if the players.Num() >=4 and calculate the rectangle, and use the other method otherwise.

Cheers

Clients don’t stay with SharedCamera

This is an Amazing tutorial and so helpful. Thank you to all who have assisted and helped with it so far.
I have a question though, i Am struggling to get it to stick though. it works for the first couple seconds and sets all clients to an actor camera which doesn’t exist. the server stays with the SharedCamera though.
any help would be greatly appreciated

Thanks for trying it out and leaving a reply!

As of 4.10.0 the Minimum Area Rectangle was working error-free in my prototype with 2 player-controlled characters. My multiplayer is currently limited by the number of controllers I have but I did test with a 3rd and 4th static character and the Minimum Area Rectangle functioned normally in both cases.

I was so keen to be able to contribute something that I’ve likely skipped over something in my blueprints that is necessary to get it all working. As I mentioned at the top of my first post I made a few changes to the original to fit my needs; knowing me I’ve forgotten to include one of those.

I’m in the process of reinstalling UE4 and some Autodesk programs after OS issues. Once I’m set up again I’ll compare my blueprints against the originals here and add another reply with updated screenshots.

Thanks again for replying, take care.

EDIT: Can confirm that I skipped some parts of the blueprint.

In my blueprints I find the float distance between my two players and use that to set the camera arm length. This fits in at Step 2 of my previous post:

Step 3 seen above is also cut in half, here is the rest:

I also recorded a short video with debugging on to show that it works with 2 players:

Hi you guys I’m kind of new but I wanted to make a game like smash bros and PlayStation all stars combined as I have the concept and name made. But I need help with the camera part as I want to get the tinkers out of it before I go to Kickstarter to look for help funding the game.if someone has an update of the camera I need and would send me the file id like that, but id rather prefer for some explanation to learn. Also I’m looking for people who’d like to help with the design of the game as id be willing to pay for people who are good in Mudbox ect. to help me make my drawn characters into game characters.

Sorry to bother but if anyone is still on this thread would you mind helping me with this camera?

does anyone still check this thread as I would like help from any of you guys if that’s possible

Thank you so much! :slight_smile:

Im getting the same error as can someone help?

@ YOU are my hero bro
can you drop me your email.

This is amazing thanks very much!

Alot of the images in this topic are not there anymore making it really difficult to follow the tutorial. Is there anything that can be done about that? Do you know any other tutorials like this?

1 Like