I have read that player controller is a class which gives input to pawn but it was also written that input facility can also be added directly into pawn class.I have few question 1)so what is the use of player controller? 2) can my game run without any player controller? 3)what is auto posses?( read in forum that only that pawn will move which is auto possessed but i didn't understood the concept) 4)what is default player controller? 5)how many player controller can i have in a level?
I am a noob and recently started learning ue4. so if any of my questions is invalid then sorry for that.please clarify my concept of player controller. thanks
1)so what is the use of player controller?
- Player Controller class is the parent class that you can inherent any controller class from it to your players , where you setup all the logic related to your controls , mouse input, keyboard input, joystick...etc
2) can my game run without any player controller?
- No you cant , unreal engine will not you do this, bec by default, unreal engine assign a default player control class , thats how you able to navigate inside your game once you hit play at first time you hit play inside the editor for empty level .
3)what is auto posses?
- its how engine assign your control on playable character , lets say you have 2 character in the map, one driving the car and one carry the gun , and you want to switch between them and take the control on them, thats how Possesing work, but setting it auto, will assign you directly to default mainplayer class . read this document Posses Pawns PossessPawns/Blueprints
4)what is default player controller?
- Its just as you read it, its the default player controller class , you dont use it, you do your own player class where its parent are Default player controller
5)how many player controller can i have in a level?
- Depends on how many players "Types" you want at your level , bec you just do the player controller class , then just instances will be used by different players.
Really I suggest you learn through epic games resources video .
Epic Games Academy
and this course is awesome too
Udemy Unreal Engine Course
Related
I'm new to UE4 and I'm trying to make split screen view.
It is extremely simple in Unity, but I can't find anywhere how can I do it in Unreal. Help me please.
I'm a uni student newly studying Unreal, and I'm creating a vehicle game. Vehicles are set up a bit differently from "fps shooter", or "third person character" The ways you can use split screen is; by adding player starts to your game mode blueprint.
I am a beginner with unreal engine. My end goal is to play an animation in the user interface that makes the word "coin" move. I have a blueprint called "BP_Coin" which spawns coins that the player can pick up and have it added to their total. When the coin is picked up, I can't get the animation of the "coin" text to play. The animation is in the widget blueprint called UIWidget.
I assume casting is my only issue, but am I doing this inefficiently? What's the easiest way to accomplish something like this?
I've followed a tutorial that mentions creating a reference with a game instance class and using that in the object slot of the CastTo, but I was unsuccessful. It would always come up with "cast failed".
There should be a CreateWidget node (documentation) somewhere in your blueprints in order to even display widget on player's screen. You may pass output of that node into CastToUIWidget function to achive what you probably need.
Hope that answers you question.
I'm making my own match 3 multiplayer game, the concept is to have two people face off against each other person can face off another person by swapping tiles to make a line of the same form. I want to introduce multiplayer by connecting two players together and allowing each person to see their opponent's screen, as well as syncing their moves. So far, I have a simple match 3 game (I created one using different tutorials, mainly this playlist) and followed a simple multiplayer tutorial (Mirror) for a player to host or be a client. My problem is that I have no idea how to show both players their opponent's screen to each other. I even found an example of what I want the multiplayer mode in my game to be like. Can anyone point me in the right direction, please and thank you.
Additional information:
I'm using mirror for multiplayer
I created a network manager gameobject and added the necessary components to it. I also added the game pieces into the 'registered spawnable prefabs' and created an empty gameobject, called player for the player prefab.
Each game piece has a network transform and network identity component attached.
The player prefab object has a camera child under it to.
This is what I want my game to look like:
Overall, I want to have player's view each other's screen:
As you can see, both player's are connected, what I want to do it to allow each player see their opponent's screen. Does anyone have an idea on how I can do it?
Thank you! :)
Earlier in the day i figured out why my game doesn't work on multiplayer. The reason is that I use the "get player controller" which gives me the index 0 so i can't work. But i use this to get location where my player has to look at (for the get hit result under cursor) and I also use that for make spawn the projectile that my player launch.
Do you have an idea of what i could use to make my game work on multiplayer.
Here are 2 screen. Let me know if you need some other informations.
event to launch a projectile;
function rotate to face cursor
On the Character or Pawn, you can simply use GetController and cast it to a PlayerController
Remember that you cannot get a client's player controller from another client. Controllers exist only on server and who owns it (the player).
I'm very new to Unreal Engine 4 and have been following an fps guide online!
Currently have an AK and M4 in the game and can switch between the two using 1 / 2 on the keypad. I had to setup the first aim down sights camera to the AK and it works well! However if I equip the M4 and aim down sights then the camera is no longer in the correct spot and it doesn't line up at all with the ironsights. So I added another camera called M4A1 ADS Camera, but can't figure out how to switch to that camera when aiming down sights then going back to the AK camera if using that weapon.
Is there a better way of doing this or any tutorials / tips to help with the process for the future?
If I want to try and answer your question I'd say that you should add a switch case or make branches to check wich weapon is equipped at the time.
But I'd say a better way to do this would be to add a camera to your weapon blueprint then you could access the camera from the weapon directly (assuming you have a master weapon class). This way you would configure 1 ADS camera per weapon and align it properly in it own blueprint.
you can use "Set View Targent With Blend" function to change your cameras, it is very good for changing speed, and blending other things.
I know this is old but even cleaner than Deimos's suggestion would be to have an ADS camera component on your character and attach it to a socket you create on each of your weapons. You can adjust the socket position and rotation on each weapon's skeleton and then all you do from the character side is attach the camera to the weapon any time you equip one.