No announcement yet.

Updating sun height during gameplay

  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    Ah, I see, I have to assign a portion of the pre-made graph to the tick event.. Is there a C++ version of the BP_Sky_Dome... I hate working with the graphs, they're so confusingly spidery.

    Leave a comment:

  • started a topic Updating sun height during gameplay

    Updating sun height during gameplay

    • Just as a test I created a class based off of the AActor.
    • I then made a copy of the BP_Sky_Dome (or whatever its called)
    • I replaced its parent blue print with my new SkyDom class which was based off of AActor (as stated above)
    • I created a new public variable called SunHeight and made it editable

      class ****_API ASkyDome : public AActor
      	UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = Lighting)
      	float SunHeight;	
      	void Tick(float DeltaTime) override;
      	float SunRiseSpeed;
    • I placed the Tick event in and set PrimaryActorTick.bCanEverTick = true; in the construct method.
    • I replaced all original sun height references in the blue print nodes to my new available class property. Yes, all of them.
    • On tick I increase the sun height counter hoping for a sun rise... nothing happens, but the sun height does increment...

    What am I missing from this? I see that the BP_Sky_Dome blueprint only simulates once on launch of game, how do I make it update on my tick? It is running over my tick code... that's for sure!

    void ASkyDome::Tick(float DeltaTime)
    	SunHeight += SunRiseSpeed;
    Last edited by jimmyt1988; 08-10-2014, 04:41 PM.