on so we're going to go into a constructor and we're going to create that projectile movement component in C++ so again this is just practice to help nail this idea down so we want to use create default sub object to make the component it is called the projectile movement component you need to give it a name in our case we're going to call it bullet we'll just call it bullet movement and remember that we need to store this in a variable so we're going to create a variable for that now so we'll just go whoops I'm gonna say bullet moves meant and we're going to expose it to the editor using our you property and then finally store that in the constructor one thing you're also going to want to get into the habit of doing is sitting the root component so actors are made up of a bunch of different components but there is a root component right and then other components attached to that component so you can build hierarchies of components that sort of attach to each other and in our case I think it makes sense to have the bullet mesh be the root component so to do that you just call this function set root component and we want to set the bullet mesh to be the root component let's go ahead and run the local windows debugger and we'll actually have a look at this functionality as well so again we're gonna have to include the header file in our case we need to get a game framework slash projectile movement component you'll understand where all the header files are as you do more coding this is kind of just memory like as you code more stuff you'll just remember where these header files are but of course you can always just Google and the documentation will tell you where the header files are as well so let's run another debugger session and I'll show you what the result of that is now so let's go to the content folder and open up the BP my bullet that we made before and we'll open the full blueprint editor and check it out so we have the bullet mesh that we created and we've set it to be the sphere and we also have this new component called bullet and movement and if I click the drop down here there are a bunch of different categories but projectile is what we're going to look at and you can see that they're the initial speed is zero and the max speed is zero so if we drop this in to the level it doesn't do anything but like I said the blueprint is the perfect place to actually set these values up so I'm just gonna set this to five thousand and five thousand we'll hit compile hit save and now when you drag this in to the level it's already set up it's ready to go it's got the the ball it's got the values sit for five thousand if you have a look here you can see these are set to be five thousand and if at play you can see that they shoot across the level just fine lastly I kind of want to talk about best practices when it comes to these components so while blueprints are nice for changing values if you can change a value easily in C++ you probably should so sit the bullet mesh to be a sphere is actually really annoying to do from C++ it's way better to do that sort of thing in blueprints but in C++ it's really easy to set the initial speed of the bullet movement in fact all we need to do is bullet movement initial speed equals
NO_SEGMENT_TOKEN