Search Unity

directory not found exception could not find part of path

Discussion in 'Scripting' started by Funkdahoe, May 10, 2021.

  1. Funkdahoe

    Funkdahoe

    Joined:
    May 6, 2021
    Posts:
    6
    Shows an unhandled exception. system.reflection.target invocationException. the directory from my ssd to the folder i made, the game, library, scriptassemblies, and assembly-CSharp.dll
    My code that i put in before this issue:
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class PlayerMovement : MonoBehaviour
    6. {
    7.     Rigidbody2D body;
    8.  
    9.     float horizontal;
    10.     float vertical;
    11.     float moveLimiter = 0.7f;
    12.  
    13.     public float runSpeed = 20.0f;
    14.  
    15.     void Start()
    16.     {
    17.         body = GetComponent<Rigidbody2D>();
    18.     }
    19.  
    20.     void Update()
    21.     {
    22.         // Gives a value between -1 and 1
    23.         horizontal = Input.GetAxisRaw("Horizontal"); // -1 is left
    24.         vertical = Input.GetAxisRaw("Vertical"); // -1 is down
    25.     }
    26.  
    27.     void FixedUpdate()
    28.     {
    29.         if (horizontal != 0 && vertical != 0) // Check for diagonal movement
    30.         {
    31.             // limit movement speed diagonally, so you move at 70% speed
    32.             horizontal *= moveLimiter;
    33.             vertical *= moveLimiter;
    34.         }
    35.  
    36.         body.velocity = new Vector2(horizontal * runSpeed, vertical * runSpeed);
    37.     }
    38.  
    39. }
    [ICODE]
    [/ICODE]
     
    Last edited: May 10, 2021