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"

Help with Inputs, please!

Hello. I'm currently experiencing some troubles to get the results I want, so please someone help me.

I'm having this issues:

  • I created a manager that provides the inputs for two pawns. However no inputs work as intended. iI have three classes (Cam Manager, RTS Camera and Game Pawn). My manager controls in two TArrays the number of cameras and game pawns. What i want is for manager to set the inputs of both the other classes,and for a given pawn to be controlled but it isn't working.

  • I can't seem to get how to move a pawn towards the mouse direction.. What I want to do is to move my camera pawn towards the direction the mouse is in the viewport. Like this: If I move my mouse to the right edge of the screen/viewport, I want my spectator cam to move in that direction, but I don't understand how to do it.

  • I don't understand how to zoom in and out with my cameras. What I want here is to simply alter the length of a spring arm using the mouse scroll (Scroll Up to zoom in and scroll down to zoom out). I think I'm doing it wrong and I wanted to know hot to do it

Please, help. It's for educational purposes and I can't get it to work.

Here are some code bits:

 UCLASS()
 class PRACTICE_API ACamManager : public APawn
 {
     GENERATED_BODY()
     
 public:    
     // Sets default values for this actor's properties
     ACamManager();
 
 protected:
     // Called when the game starts or when spawned
     virtual void        BeginPlay() override;
 
 public:    
     // Called every frame
     virtual void        Tick(float DeltaTime) override;
 
     // Called to bind functionality to input
     virtual void        SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
 
     // Functions
     // Change perspective to either RTS or action
     void                ChangePersp();
     // Add a spectator cam to the world
     void                AddCam();
     // Remove a camera from the world
     void                RemoveCam();
     // Switch from the current camera to the next camera on the list
     void                SwitchCam();
 
     // Check if we passed a camera before starting the game or need to create one
     void                CheckInitialCam();
     // Display controls on a debug message
     void                DisplayControls();
     // Display messages of the world
     void                UpdateMessagesDisplay();APlayerController* OurPlayerController;

 // Members
 // Defines if the active mode is RTS (true) or ACTION (false)
 bool                m_RTS;

 // Camera index number, used to create cameras with an identifier
 uint32                m_CameraIndex;
 uint32                m_PawnIndex;
 
 // Blending time to pass from active RTS cam to pawn cam 
 UPROPERTY(EditAnywhere)
     float            PerspectiveBlendTime;
 
 // List of RTS cams existing in the world
 TArray<ARTS_Cam*>    m_RTSCams;
 // List of selected pawns
 TArray<AGamePawn*>    m_SelectedPawns;

 // Initial cam
 UPROPERTY(EditAnywhere)
     ARTS_Cam*        InitialCam;

 UPROPERTY(EditAnywhere)
     AGamePawn*        InitialPawn;

 ARTS_Cam*            ActiveCam;

 UPROPERTY(EditAnywhere)
     AGamePawn*        TestPawn;
 };




Product Version: UE 4.15
Tags:
more ▼

asked Aug 14 '17 at 06:53 AM in C++ Programming

avatar image

manusanram
1 1

(comments are locked)
10|2000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
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