Announcement

Collapse
No announcement yet.

PlayerLaunch on Spawn

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    PlayerLaunch on Spawn

    Im trying to either change a character velocity or use LaunchCharacter() right as the game begins or when a new player spawns. I've found that changing velocity or calling PlayerLaunch() in the character's PostInitializeComponents() does not work.

    I noticed similiar behavior in UDK, I fixed it in a hacky way by checking to see if each tick was the pawn's "first" tick, and changing the velocity there. Any ideas for a more elegant way to handle this in unreal engine 4?

    #2
    Originally posted by dfjarvis View Post
    Im trying to either change a character velocity or use LaunchCharacter() right as the game begins or when a new player spawns. I've found that changing velocity or calling PlayerLaunch() in the character's PostInitializeComponents() does not work.

    I noticed similiar behavior in UDK, I fixed it in a hacky way by checking to see if each tick was the pawn's "first" tick, and changing the velocity there. Any ideas for a more elegant way to handle this in unreal engine 4?
    To clarify, have you tried doing it in the BeginPlay function/event?

    Comment


      #3
      Yes, have tried the character's BeginPlay() function as well - same result.

      Comment


        #4
        Originally posted by dfjarvis View Post
        Yes, have tried the character's BeginPlay() function as well - same result.
        And you've tested it in, say, the character's Tick? Just to make sure that it isn't the approach to changing velocity that's the problem?

        Comment


          #5
          Solved this: The issue was a combination of factors including something in the CalcVelocity function or PHYSFalling() adding friction even though I thought I set that all to 0. Not sure what exactly it was, I didn't need most of the code in those functions so I just rewrote them to be very basic.

          Comment


            #6
            Originally posted by dfjarvis View Post
            Solved this: The issue was a combination of factors including something in the CalcVelocity function or PHYSFalling() adding friction even though I thought I set that all to 0. Not sure what exactly it was, I didn't need most of the code in those functions so I just rewrote them to be very basic.
            Pleased to hear that

            Comment

            Working...
            X