Search Unity

Script not working on an imported asset

Discussion in 'Scripting' started by Ishaq_, Jun 7, 2020.

  1. Ishaq_

    Ishaq_

    Joined:
    Jun 7, 2020
    Posts:
    1
    Hi, I'm a new unity and c# developer. I am currently working on a simple game where a player controls a rocket sprite through obstacles. I made a very simple script to make the obstacles rotate. The obstacles I am using are from a free imported asset pack from the asset store. However when I apply the script to the imported obstacles it does not rotate. I tried applying the same script to a regular gameobject on unity and it worked like a charm. For some odd reason it doesn't work when I apply it to the imported assets. Does anyone know why it isn't working?
     
  2. Yoreki

    Yoreki

    Joined:
    Apr 10, 2019
    Posts:
    2,605
    Some potential reasons may be:
    • The asset object may have a script attached which handles movement, overwriting your changes
    • The asset object may have a rigidbody, but blocked rotations/movement on some or all axis
    • In some rare cases the mesh of the object is entirely handled through a shader, which doesnt seem likely for an obstacle tho
    Pretty sure it's the rigidbody component with a blocked rotation and movement, since that would make sense for an obstacle.
     
    leftshoe18 likes this.