Im trying to create an area where the camera is in a 2D angle and the controls are limited to being able to move only left and right. Thanks in advance!
Hey @StatikkJoe! Welcome to the forums!
So with this amount of information, thereâs not much we can suggest. If you can get us a more in-depth description of what you already have, where you are in your game- maybe some code snippets of what youâre already trying?
Thanks!
are you using the Project Setting
or Enhanced Input Subsystem
for your input
either the trigger will tell the Actor that the change shall take place, or the Character will signify it is in the trigger. the Actor being told of the change is cleaner, and will lead to more re-usability, modularity, and less casting (for lower memory footprint)
the simplest answer for either method before optimization is to have a boolean check in the forward-back
and maybe Look
for when the bool is in state then it disallows reading those inputs.
for the Enhanced Input Subsystem: you can create an Input Mapping Context that just doesnât include the Forward-Back
and Look
inputs. Just be sure to change it back when they leave
either implementation can be accomplished by communicating the change with the OnOverlapBegin()
and OnOverlapEnd()
the next step is to constrain the Camera, this will vary/depend on the implementation you are using for the Camera. where like the third Person Camera will need to set CameraBoom->bUsePawnControlRotation = false
(again remembering to reactivate this on returning everything)
I would strongly suggest that you attempt to smooth transition/interpolate the camera if it needs to be moved in terms of angle to accomplish your effect
This is what I did so far. the only thing thats missing is limited the controls and making the camera follow the character in the 2D view angle.
Is that what you mean? I am just not sure how to execute it because I already have my begin overlap plugged in
excuse me im fairly new to the engine so it might seem like I have no idea what I am doing.
in your character blueprint create a function View2DChange(bool bIs2D)
(could promote to an event if need be) have it take in a bool (at least for now, and then expand the functions arguments/inputs to include a look at point)
then in the View2DChange
use the passed in bool to control the transition, it will set the blend target, and modify the cameraBoom rotation.
if you centralize what changes state values of an object then you donât have to potentially look in a bunch of places to address issues that can/will occur over the course of development,
it is a programming âbest practiceâ to have objects be responsible for themselves as much as possible, unless that responsibility is to be delegated by a manager; even then the Object should only be receiving directives, and then changing its own state values (if your employer or parent tells you, that âyou should go to bed earlyâ you are responsible to go to bed, they âshouldnâtâ be physically putting you in bed)
in the blueprints there is technically no limit to how many things can be stretched off of the White-Triangle Exec pin, as long as it makes sense to do so.
I already did the camera 2d view and its working smoothly. All what I am asking for is how to limit the controls to only go forward and backward (which would be in the 2d angle left and right), which means I needed more clarification on the comment you did earlier please. I am relatively new to blueprints so I might seem kind of dumb.
you would put the limited input either into the same place the normal movement would be done for a bool type implementation:
or if you are using the Enhanced Input Subsystem then you can also create a separate Input Action that is assigned to a different Input Mapping Context
You can look here How can I disable InputAction except some Input Action In Enhanced Input? for more details on the differences between the 2 implementations.
I got it to work like this.
I seriously donât know how to thank you. I appreciate you being patient with me being as a beginner.
i just changed the get node coming out of the Cast To BP_ThirdPersonCharacter
into a set and made it to false. Now it works perfectly fine.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.