If Variable, Stop?

I am setting a float variable to some number and I want it to be attached to the Yaw module on the MakeRot node. This value will give the light a rotation to make it day or night, rather than the day or night be set to a cycle.

I want the cycle to run unless unless the float variable is set to a number. Then instead the time of day will be set to day or night. However when I try to implement this to the given blueprint, my day or night flickers as if it is not just being set but is being updated horrifically.

How can I keep the cycle, but if I choose a value to be updated, the Yaw will ignore the SunSpeed * Delta Seconds and will just set to the given rotation value, giving it a paused effect at either day or night?

If I could find a way for the cycle to run until the set value is achieved by the MakeRot, and stop, I would do that also.

Hi ,

The node you are looking for is “Set Actor Tick Enabled”. This will allow you to determine when the tick is firing. What you can do is have a branch that checks if the value you are checking is == to the set value to stop. If true, run “Set actor tick enabled” and set it to false, this will freeze your tick so it doesn’t continue running while you are trying toupdate the day/night cycle differently.

71044-tickenabled.png

It fixed my problem real quick, however it disallows my emitter from updating its position with EventTick.

How can I set up the target of SetActorTickEnabled to just change the tick of my day/night cycle?

Use a timer instead of tick and then simply use the pause timer by function name node. You can set the timer to an extremely low value to come close to tick without having the day/night cycle act as framerate dependent. This would also allow you to continue using tick for other functions without interrupting it. Another Alternative would be to have a sequence that contains each set of functionality. Any functionality you want to stop put a branch in front of it. When you reach the desired value, set the bool to false so that it cannot continue running but does not affect the tick’s flow.

Could you show me how to integrate that type of node into the bp listed above? I do not have pause timer by function name node.

So a timer would act as delta seconds, being a measurement of a tick (or close to, as you describe)? What type of timer?

Use a select float, and a make literal bool. This will select the float you want to use based off your variable conditions.

photo nmm131Solution_zpsbbj2io9y.png

Is it possible to remove the SetActorTickEnabled or to disable it with another node? The target on SetActorTickEnabled is useless to me since promoting the target to a variable just sets it to actor. My cycle does not really have a target except light source and sky sphere and those wouldn’t work.

That allows for my other EventTick nodes to work along with my set day or night. My cycle will not work though. Is there a way to set A to EventTick and B to EventBeginPlay depending on the value of the boolean? True & False?

B (boolean) is set to checked when the S value, or in select node the B value is not set. So when B boolean is being set along with S value, which plugs into B on select node, B will remain unchecked and B will be picked and give the correct pitch to change day or night. However it will flicker from daylight to whatever int value is picked.

CastToMyGameInstance holds all the variables for use, as they are being set outside the bp. It is connected to an EventBeginPlay.

How come this makes my day/night flicker when B is being picked? This is the only flaw I have with the select node:

"I want the cycle to run unless unless the float variable is set to a number"

I’m assuming this is being set by beginplay? Or is this sunspeed? the formula above I created based off the assumption that the float variable you referenced was sun speed.

"Is there a way to set A to EventTick and B to EventBeginPlay depending on the value of the boolean? True & False?"

If you create a variable that is updated on eventbeginplay and eventtick, you can use that as the select bool. If thats what you mean?

Well SunSpeed * Delta Seconds changes the Yaw to create the cycle. When I drag in the S variable from MyGameInstance it acts as, say 0 degrees yaw or -135 degrees yaw for a set day / night as opposed to a cycle.

SunSpeed will just alter the length of one cycle. Everything works, the cycle and setting the day or night. However when it is set to just day or night, the night flickers (starts at night, flickers to day then back to night in a millisecond, & will not stop) like if it were being set multiple times.

Everything from MyGameInstance (Boolean “B” and Float “S”) is being set in the event graph of a widget inside a separate level.

This may not be related to the issue but I have had strange things happen when I’ve ran a large amount of sequences off event tick.

I figured out your problem, AddLocalRotation is constant. If you want the sun to stay in a specific spot you need to SetRotation.

I was mistaken. The CastToMyGameInstance was hooked up to EventTick, I changed it to EventBeginPlay and my day/night had no problem with flickering. However my cycle would not begin. I start the game without having S or B SET, the default values are 0 and checked. So until I set S and B in the other level, the day/night won’t enact, it should start with the cycle but it is not for some reason.

If I have either the cycle or the S variable (without eventTick delta seconds * sunSpeed) plugged into MakeRot → Yaw plugged into -->AddActorLocation → UpdateSunDirection they both will work separately. I don’t have SetLocalRotation

I have SetActorRotation which doesn’t work.

B boolean is automatically set to checked every time unless I change it in the separate level, which is when S is set a value as well.

I am reading that if boolean is checked, which it is always until set to unchecked from separate bp, then pick the value A which is set to SunSpeed * Delta Seconds.

Thats because in your screen shot it looks like If b is checked then you are selecting to use S which is 0. So you are adding no rotation at all. You can either switch a and b or use a NOT boolean instead of = for B, I have to run I will be back in an hour or two and I will check back.

If I remember correctly placing any number into AddRotation will cause it to continue adding that rotation. Where as SetRotation sets it to a specific point. One is dynamic and one is static.

I put in a number for yaw and because it was hooked to an EvenTick, it kept going haywire.

I tried using a DoOnce however my cycle worked and my day/night did not.