Forum begins after the advertisement:


Canvas bugged.

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #11658
    InoXtiC
    Level 1
    Participant
    Helpful?
    Up
    0
    ::

    This happens like few days ago making my Canvas unable to be showed pretty much bugged. I managed to fix most of it but my inventory had an issue.

    <img src=”https://i.imgur.com/7CLujyP.png” alt=”Error code” />

    How do i fix that?

    Also there’s issue with the cabbage being unable to pickup. Its not rendered on the player head, nor registered in the inventory after picking up the invisible cabbage, however the cabbage on the farmable area disappear.

    #11659
    InoXtiC
    Level 1
    Participant
    Helpful?
    Up
    0
    ::

    Okay it seems that i managed to fix the issue, now its the second bug where the cabbage thing.. hmm

    #11661
    Terence
    Level 32
    Keymaster
    Helpful?
    Up
    0
    ::

    Hi Sync, are there any errors that appear on your Console when you harvest the cabbage?

    You can also have a look at Part 17 of the series, where a couple of bugs are addressed in the first part: https://blog.terresquall.com/2022/12/creating-farming-rpg-in-unity-part-17/

    #11662
    Jonathan Teo
    Level 18
    Moderator
    Helpful?
    Up
    0
    ::

    It could be either a UI issue or the Item not registering.

    When you pick up the cabbage in the scene, check InventoryManager in the Inspector under the ItemSlots array. Do you see the Cabbage ItemData in any of the slots? If yes, the issue is somewhere with the rendering of the UI.

    If not, check the Cabbage prefab. Do you have the Cabbage ItemData assigned?

    #11667
    InoXtiC
    Level 1
    Participant
    Helpful?
    Up
    0
    ::

    Okay i checked, it seems that when i harvest the cabbage it just disappear. Its not added to the UIManager either. If i have 5 at cabbage in the inventory, it should hold one on the hand when i harvest, 1 cabbage would be on Item Hand Slot and i middle mouse button it will keep to inventory adding the 5 cabbage i have to 6, but it seems that its not adding up. Weird.

    #11689
    Jonathan Teo
    Level 18
    Moderator
    Helpful?
    Up
    0
    ::

    Can you take a screenshot of what InventoryManager looks like in the Inspector?

    #11729
    InoXtiC
    Level 1
    Participant
    Helpful?
    Up
    0
    ::

    I uploaded a post, not sure if its uploaded or not.

    InventoryManager <img src=”https://i.imgur.com/mYk7T3o.png” alt=”” />

    Got this error at Part 15 ending. <img src=”https://i.imgur.com/uAJEZZG.png” alt=”Part 15″ />

    Moving room room to farm leave this error. <img src=”https://i.imgur.com/9kqrXfq.png” alt=”” />

    #11731
    InoXtiC
    Level 1
    Participant
    Helpful?
    Up
    0
    ::

    Error: duplicate reply detected; it looks as though you’ve already said that. It may seem that theres an issue where when i upload picture it being hidden or something where i am unable to see the post.

    #11732
    Terence
    Level 32
    Keymaster
    Helpful?
    Up
    0
    ::

    Hi Sync,

    Can you upload your images onto Imgur instead? https://imgur.com/upload

    The forum blocks links if you put too many of them together in a post, as that makes the post looks like spam.

    #11735
    InoXtiC
    Level 1
    Participant
    Helpful?
    Up
    0
    ::

    Heres my InventoryManager <blockquote class=”imgur-embed-pub” lang=”en” data-id=”mYk7T3o”><a href=”https://imgur.com/mYk7T3o” target=”_blank”>View post on imgur.com</a></blockquote><script async src=”//s.imgur.com/min/embed.js” charset=”utf-8″></script>

    #11736
    InoXtiC
    Level 1
    Participant
    Helpful?
    Up
    0
    ::

    Heres the error after i communicate with ben or jeff <blockquote class=”imgur-embed-pub” lang=”en” data-id=”0DsJRQ3″><a href=”https://imgur.com/0DsJRQ3” target=”_blank”>View post on imgur.com</a></blockquote><script async src=”//s.imgur.com/min/embed.js” charset=”utf-8″></script>

    #11737
    InoXtiC
    Level 1
    Participant
    Helpful?
    Up
    0
    ::

    Heres the error when i enter town from home <blockquote class=”imgur-embed-pub” lang=”en” data-id=”hGj7bvv”><a href=”https://imgur.com/hGj7bvv” target=”_blank”>View post on imgur.com</a></blockquote><script async src=”//s.imgur.com/min/embed.js” charset=”utf-8″></script>

    #11749
    Jonathan Teo
    Level 18
    Moderator
    Helpful?
    Up
    0
    ::

    Something is not set.

    You can double click the error to get to the line where the NullReferenceExceptions are occurring, and see which variable isn’t set, and then trace it from there.

    For instance, it looks like in the case of the InventoryManager, <code>itemSlot</code>or <code>inventoryArray</code> is unset in the <code>StackItemToInventory</code> function.

    In the case of the Characters, check if <code>characterData</code> is set.

    #11728
    InoXtiC
    Level 1
    Participant
    Helpful?
    Up
    0
    ::

    Heres the InventoryManager <img src=”https://i.imgur.com/mYk7T3o.png” alt=”Heres the InventoryManager” />

    Theres this error at Part 15, ending part.. whats wrong here? <img src=”https://i.imgur.com/uAJEZZG.png” alt=”Part 15 ending part” />

    There are many issue i encounter so far such as, going from farming to home would have error <img src=”https://i.imgur.com/9kqrXfq.png” alt=”Like this” /> I think its the load time of my computer. Which i am unsure about.

    #11851
    Terence
    Level 32
    Keymaster
    Helpful?
    Up
    0
    ::

    Hi InoXtic,

    Sorry that the forum is flagging your message as spam. I’m looking into it. In the meantime, you will need to avoid posting too many links on your post, as it will cause our anti-spam software to falsely flag it as spam.

    <h2><code>NullReferenceException</code> error</h2>

    For the <code>NullReferenceException</code>, look at line 52 of your <code>InteractableCharacter</code> script. These exceptions are usually caused when you try to access a property that is not there. For example, the <code>rb.velocity</code> line below will cause a <code>NullReferenceException</code> if <code>GetComponent<Rigidbody>()</code> fails to find a component:

    <pre>Rigidbody rb = GetComponent<Rigidbody>(); rb.velocity = new Vector3(5,5,5);</pre>

    This is because <code>rb</code> will be <code>null</code> if the first line fails. Hence, the code resolves to <code>null.velocity</code>. Below is a video explaining more about <code>NullReferenceException</code> errors:

    <iframe title=”What NullReferenceException errors are (and how to fix them)” width=”1000″ height=”563″ src=”https://www.youtube.com/embed/dHyksxGUYbo?feature=oembed” frameborder=”0″ allow=”accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share” allowfullscreen></iframe>

    <h2>Entering town error</h2>

    For the error when entering town from home, you can double click on the error to show the line of code that is causing the error. Then just do a check to make sure that variable is not null. Something like this:

    <pre>public void OnLocationLoad(Scene scene, LoadSceneMode mode) { //The location the player is coming from when the scene loads Location oldLocation = currentLocation;

    <code>    //Get the new location by converting the string of our current scene into a Location enum value
        Location newLocation = (Location) Enum.Parse(typeof(Location), scene.name);
    
        //If the player is not coming from any new place, stop executing the function
        if (currentLocation == newLocation) return; 
    
        //Find the start point
        Transform startPoint = LocationManager.Instance.GetPlayerStartingPosition(oldLocation);
    
        if (playerPoint == null) return;
        //Disable the player's CharacterController component
        CharacterController playerCharacter = playerPoint.GetComponent<CharacterController>();
        playerCharacter.enabled = false; 
    
        //Change the player's position to the start point
        playerPoint.position = startPoint.position;
        playerPoint.rotation = startPoint.rotation;
    
        //Re-enable player character controller so he can move
        playerCharacter.enabled = true;
    
        //Save the current location that we just switched to
        currentLocation = newLocation; </code>

    }</pre>

Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.

Go to Login Page →


Advertisement below: