Hey, everyone, I'm building a game involving firing a shot from a cannon and I want to be able to have the projectile speed/distance be based on the progress bar, like turtle toss or kitten cannon. How can I control the power of the shot based on the progress bar?
Announcement
Collapse
No announcement yet.
Projectile Speed based on progress bar
Collapse
X
-
If your projectile is an actor and you are creating it using a "Spawn actor from class", you can set up a variable (probably a float) on your projectile actor that is "editable" and "expose on spawn". Then, wherever you run the "Spawn actor from class", you will be able to pass in a value for that float. In your projectile actor, on begin play, use the passed in variable to set the velocity in the projectile movement component. You could use the value passed in as a percentage and multiply it by a "Max Speed" to perform your calculation.
Comment
-
Looks like you would need a BP/code that calculates that and can be accessed by everyone. Try doing this in GameMode.Check out my itch.io page, I'm really excited about it.
https://kinos141.itch.io/
Please check out my AI package: Action AI System Feat. Stealth
https://www.unrealengine.com/marketp...m-feat-stealth
or get it from itch
https://kinos141.itch.io/action-ai-system-feat-stealth
Comment
Comment