How to console log what item I picked from the center of the camera

I didn’t see anything wrong in the other scenes. If you get an error, please share a screenshot.

the console is not logging when i have mouse down

You did not. :sweat_smile:

The current script doesn’t exist:

image

Result should be:

image

currently i am frustrated when i put in the name correctly it formats it to be lowercase and nomater if i copy and past it it is not currently working.

After changing the name of the script, the script with the old name doesn’t exist anymore. That’s why you have to remove that script and add the script with the new name.

Your current script is not with is a lowercase?

2 Likes

no

the raycast script is not telling me what object it has hit

It’s working for me.

Probably you don’t see it because all the warnings that are coming from your progressBar script.
I suggest to change the code of that script with the code below.

var ProgressBar = pc.createScript('progressBar');

// The entity that shows the fill image 
ProgressBar.attributes.add('progressImage', {type: 'entity'});
// The maximum width of the fill image
ProgressBar.attributes.add('progressImageMaxWidth', {type: 'number'});

ProgressBar.prototype.initialize = function() {
    // use our own rect object to set the size of 
    // the progress bar
    this.imageRect = this.progressImage.element.rect.clone();
    
    // initialize progress to 0
    this.setProgress(0);
    // if true the progress bar will increase 
    // otherwise it will decrease in update
    this.increase = true;       
};

// Set progress - value is between 0 and 1
ProgressBar.prototype.setProgress = function (value) {    
    // clamp value between 0 and 1
    value = pc.math.clamp(value, 0, 1);
    
    this.progress = value;
    
    // find the desired width of our progress fill image
    var width = pc.math.lerp(0, this.progressImageMaxWidth, value);
    // set the width of the fill image element
    this.progressImage.element.width = width;
    
    // Set the width of the element's rect (rect.z) to be the same
    // value as our 0-1 progress.
    // This is so that the fill image will only show the portion
    // of the texture that is visible
    this.imageRect.copy(this.progressImage.element.rect);
    this.imageRect.z = value;
    // force rect update
    this.progressImage.element.rect = this.imageRect;
};

// Increase or decrease the progress automatically
ProgressBar.prototype.update = function(dt) {
    var diff = this.increase ? dt : -dt;
    this.setProgress(this.progress + diff);
        
    if (this.progress >= 1)
        this.increase = false;
    else if (this.progress <= 0)
        this.increase = true;    
};
1 Like

whats this i made the change

I don’t know and I don’t get that error. I don’t think it’s related.

Maybe it’s because this ‘empty’ New Json file. Please try to remove it.

image

Untick Concatenate Scripts in the launch button dropdown

There’s a bug where this option doesn’t work: Concatenate scripts doesn't work in the launch tab · Issue #687 · playcanvas/editor · GitHub

no dice. should i try to restart?

What do you mean ‘no dice’. Can you post the URL of the launch tab for us to take a look at please?

Can you post a screenshot of your launch tab options that you have set like I’ve done in my post please?

https://launch.playcanvas.com/1360663?debug=true
image

Looks fine on my end besides some batching errors where some groups have been removed (you will need to remove them in the render components)