Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Class ParallaxingSkyboxViewpoint : SkyViewpoint
- {
- //$Title Parallaxing Skybox
- //$Category Cameras And Interpolation
- Vector3 startPos;
- int user_skyparallax;
- override void BeginPlay ()
- {
- Super.BeginPlay();
- user_skyparallax = 16; //Default value so the VM doesn't literally divide by zero.
- }
- override void PostBeginPlay ()
- {
- Super.PostBeginPlay ();
- startPos = (self.pos); // Store the starting position
- }
- override void Tick()
- {
- super.Tick();
- Vector3 playerPos = players[consoleplayer].mo.pos;
- Vector3 newPos = (startPos.x + playerPos.x/user_skyparallax, startPos.y + playerPos.y/user_skyparallax, startPos.z + (playerPos.z/user_skyparallax+0.2));
- SetOrigin(newPos,1);
- }
- }
Add Comment
Please, Sign In to add comment