Using Timers to Toggle Particle Color
AUTHOR: Charley Weaver
One of the challenges I faced this week was the alternating of particle color in the camouflage pickup in C++. Why do this in the first place? We wanted a VFX and/or SFX associated with attempting to pick up the camouflage pickup when the camouflage meter was full. This effect would indicate to the player that the pickup is unable to be retrieved at that time and give a subtle reminder that the camouflage skill was now available to use.
In order to accomplish this feat, I needed three things:
1. The ability to change the particle instance color.
2. A timer to allow for toggling of the color for a short period of time.
3. A Boolean for if the color has changed to prevent continuous cycling of color change.
See below for how I accomplished this using the three above.
Using the timer allowed the color change to temporarily occur as the ChangeParticleColor() function was called yet again to toggle the color right back to blue. Likewise, the particle instance parameter index 5 was just the vector I needed to change the color from Blue (FVector(0, 0, 1)) to Red (FVector(1, 0, 0)). The Boolean changed from false to true prevents the function from being called more than twice: first by the OnBeginOverlap() function and second by the ChangeParticleColor() function.
See results below:
The Butterfly Effect
Live the experience of a butterfly from their own eyes...
Status | In development |
Author | teaminsertnamehere |
Genre | Puzzle, Adventure |
Tags | 3D, Animals, nature, Stealth, Unreal Engine |
More posts
- Puddle Particle Bug FixAug 25, 2023
- How can I use Gamepad in the UI Widgets in Unreal Engine 5?Aug 23, 2023
- Saving Sound Settings Between PlaythroughsAug 19, 2023
- Skip NPC Cinematic with Interactive KeyAug 18, 2023
- Movement UpdateAug 12, 2023
- Solve Fly faster counter to use multiple Fly Faster power Ups inside the levelAug 12, 2023
- Save System ContinuationAug 05, 2023
- How I can hide the HUD elements during the cinematics?Aug 05, 2023
- Save SystemJul 21, 2023
- Fix Fly Faster crashJul 20, 2023
Leave a comment
Log in with itch.io to leave a comment.