Projectile Movement Initial Speed won't use a Variable from the Player Character
I have a player character which picks up a bowling ball and then is supposed to throw the ball. I tried to set the ball to use a projectile movement component that would use the power variable from the Player Character, but it never works.
Bowler Character getting power and spawning the ball:
Constructor for the BowlingBall which is spawned:
Ball Power does have a value as you can see here:
But, when the ball spawns, it just drops to the ground like the initial speed is 0. When I set it to a specific number, like 1000, it works fine.
asked Aug 02 '14 at 05:07 AM in C++ Programming
Please note that GetWorld() in this situation returns null since the World is not fully initialized when the function is called. This happens because GetWorld() is placed inside of the constructor.
In this situation MyCharacter never gets initialized and BallPower variable isn't set appropriately.
Thus, please place make sure that World has been initialized before calling the method that contains GetWorld() function.
Hope this helped!
Follow this question
Once you sign in you will be able to subscribe for any updates here