Hello! I created Niagra Leaves and wind force for him. wind force depends on ‘‘wind intensity’’ variable. I also made ‘‘wind intensity’’ change on button clicks (second screenshot). Due to the fact that I have an event beginplay - niagara does not change. How to make an optimized update? There is no desire to use Event tick, since this is not an optimized way. Any help
Hi @Ilas
Ok firstly i must point out that EventTick is perfectly fine to use for many things, and there is alot of stigma saying you shouldnt. Used right, optimaly it can be efficient and your friend.
BUT it looks like you are sending a 1 time event to update your emitter. So begin play should be fine for this. So as long as those user variables are spelt correctly there should not be a problem.
However you are better to test the theory , by firstly:
Use hard values instead of those parameters to eliminate that is not the issue. Try HIGH values which would look noticebly different ro make sure also.
If you dont notice any change then possibly the event play is hitting at your niagara system before its initialised so it doesnt get the new values.
Use event tick to test this theory. If that is the case you can still use begin play. But instead of putting the code in there, on begin play create a timer maybe 2 seconds to start with none looping. Let the timer run your update code.
If this works then shorten the timer as much as you can as long as it still works.
Have you checked your logs to see if there are any errors (click the filter button in the output log window and u tick messages so you only see errors and warnings)
These things can be sent to annoy us. Ive had problems using actor references sometimes on begin play and had to delay tick and validate check the actor until it appears valid. Notmally no more than 3 ticks usually.
Anyway, try debugging how i said to start with , then eliminate each possibility
Hi! Ididn’t express myself correctly). When starting the game - everything works, I’m just looking for an optimized way to update Niagara, since I change the wind parameters on the click of a button
You can run your updates from your button presses this wojld be perfect, or from any input type you require.
This makes it work only when required only when you update them via an input.
but the buttons don’t work in BP actors((
For this reason, I asked for help. I am changing variable value on button click and I want BP VFX to update on button click because it is the most optimized way, but buttons cannot be used in BP Actor
Buttons as i mouse or keyboard? Im not sure why they cant be used in an actor if its possessable. Pawn actors.
So how do you wish to trigger the events?
Is a player going to press something?
If you explain how you want this to work maybe we can help with a more targeted solution.
I made this logic in “ThirdPersonCharacter” - Variable data is changed by pressing two buttons. My VFX uses this variable’s data. For some reason, keyboard and mouse buttons do not work in BP Actor
Ok when you say BP actor is this your player pawn character? If so you need to make sure you allow control either by
Setting the default game pawn and player controller
Or
Ticking player0 in the auto possess by player option in the details panel in the editor when u select your player
You are sending input to your player, so the code to change the variables needs to be in the player
BP actor - AC leaves. As I demonstrated in the video, on the first run, when the Event Tick was on, I increased the intensity of the wind during the game, then I changed the Event tick to a button, and the leaves stopped changing during the game. I pressed the button))
The button code needs to be in the player NOT THE LEAVES as they do not recieve the controller input
It turns out that the most optimized option is to use event tick with a timer?
Well how do u want the updates to happen? With a button or automatically?
With a button, put the code in the player to change the variables.
Automatically you could use event tick OR a timer. If you choose event tick you can change the length of the tick timer to say every half second or second or whatever (only do this if there is nothing that needs to run at a faster rate)
But timer maybe just as good
Thank you. I don’t want to add code to the Player because then I would have to put a lot of code there since I have multiple Actors