Odd build issues: 1).[Resolved] 2) Effects only visible after reload

Oddly, when I was building my minigame it came-out differently than it plays inside Unity… specifically, I have moving objects on both of two scenes. Inside Unity when it loads the next scene I get what I expect. In the build, however, the next level’s objects are moving about 10x too fast!

I saved my work, exited Unity, and deleted the Library folder. I’m now rebuilding to see what comes-out… (I’d also deleted the build folder, for good measure).
{insert temporal delay for play-testing…}

1
Well, bummer, that hasn’t resolved the issue… I want level 2 to be more difficult, but not to that degree! lol.

New Edit: I realize I made a mistake in co-opting the Oscillator.cs for my Spinner.cs… SO, the real bug that is still outstanding is the one with the tail effect… haven’t figured that one out yet… I hope to post a fixed demo asap…

Boost Demo {this one has the bad Spinner.cs code}

Boost Demo : Fixed, and with a few new features! ^

^ I now have my orbs vanishing while leaving their cloud behind to dissipate (yay!) and based on feedback, I’ve added a feature allowing the user to select their “G” (gravity) on the fly… 0-for Earth gravity, 9-1 for decreasing levels, of #g (i.e. 3 get’s you 3 m/s/s). This way, if the default is too difficult, hopefully the user can tune the gravity to a level that makes their play-style work. The intermittent issue with the ‘tail’ effect remains…

2
I note that (for me anyway) this build has another problem that I see intermittently: there is an effect on the player that only shows-up after you’ve died 3-times and the level reloads… I’ve got NO clue why either of these issues are happening.

Summary:

  1. [RESOLVED] scene objects with motion scripts seem to be falling back to default values in my 2nd level, but only when I build; not a problem inside Unity.
  2. scene effect(s) [specifically, a ‘tail’ effect] don’t show on screen until the level is reloaded (after dying 3 times).
1 Like

Just played it.

See what you mean about the trail renderer, only shows after dying a few times.

I cant get to level 2 cos im rubbish heh

Oops… I forgot, I’ve been playing it for days, now… :stuck_out_tongue: I suppose I should turn off some of the collectibles in the 1st level so it can be cleared faster…

A couple hints and tips: In trying to come up with a “game moment” I’m messing with a concept where the player gains mass over time. This is continuous and steady, but each time you collect an orb your mass resets to 1. In other words, you have to continually “tune” how much thrust you use, because you can zip around at first, but before long, you are dragging-tail.

I’ll re-link as soon as I get one up with only a few orbs in the 1st level.

Ugh, so I put up a build with only 2 orbs on level one for easy play-testing and guess what? For me, NEITHER one of the bugs is in the new build. I see the tail right from first launch. I see proper object motion on level 2. Sigh… Thanks for being consistent, Unity, lol.

EDIT: After reviewing this I think I see my mistake (relating to object motion). I’ll be attempting to fix and re-post the demo asap. The issue with the tail effect is still intermittent and annoying though :slight_smile:

Sheesh after a couple more hours of fiddling, building, testing… all I have are more questions…

One thing that’s becoming apparent, is that the speed of the objects being moved by script is somewhat dependent upon the browser I’m using (supported Chrome vs. unsupported Opera, fwiw.) Time to try a Windows build and see if at least that performs similarly to running inside Unity IDE; because I really don’t know what else to do right now. Derp.

EDIT: Nope, the speed in the Windows build is similar to the WebGL build under Chrome… and about 4x faster than what’s happening when I test inside Unity… Frustrating. Just for the record, both scripts I’m using to move these objects are using Time.time and a user-defined period to determine rate of movement, and therefore, I presume, should be consistent from build to build and player to player. But they’re not.

Example: my Spinner.cs script –

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Spinner : MonoBehaviour {
    [Range(-1, 1)] [SerializeField] int direction = 1;
    [Range(0f, 60f)] [SerializeField] float period = 50f;
    [SerializeField] bool mode = true; 

    void Update()
    {
        if (float.IsNaN(period) || direction == 0) return;

        const float Tau = Mathf.PI * 2f;
        float cycles = Time.time / period;
        float rawSinWave = Mathf.Sin(cycles * Tau);
        float movementFactor = cycles / 2f + 0.5f;
        float offset = movementFactor * rawSinWave;
        if (!mode) offset = movementFactor;

        transform.Rotate((-direction) * Vector3.forward * offset);
    }
}

So, after feeling a bit dull for taking hours to get here, I figured-out all I needed to do was replace one line in the Spinner.cs script:

float cycles = Time.deltaTime * period;

(Using Time.time was leading to the objects spinning faster and faster as the level played-on)

The other bug, with the tail intermittently working is sometimes in the current build.
Fixed Boost Demo

This is excellent, great fun.

I find it a tad difficult, a little less gravity for more of a space atmosphere feel would make it a little easier.

The green mist is a great idea to make the player aware when they are in the location of a pod and love the engine smoke affects :+1:

Thanks @Toe71 I’ll have to try playing with that (less gravity). Probably, I should have a bit of “training” too, with a few very simple levels to start, I suppose… That gives me some ideas, actually, but first I want to fix it so when you collect an orb the green mist fades rather than vanishes in a blink.

Privacy & Terms