- Home /
Can't assign rigidbody/transform variables to an extension class asset
[CreateAssetMenu(fileName ="WalkingState", menuName ="Player State Machine/States/Walking", order =1)]
public class WalkingState : PlayerState
{
public Rigidbody rb;
public Transform transform;
public Transform gunPosition;
public LayerMask enemyMask;
public GameObject playerObject;
}
Hey, I have this WalkingState as an extension of the PlayerState class, which is an extension of ScriptableObject. I created an asset of the WalkingState class through the CreateAssetMenu, and I wanted to assign the components of my player character to the variables of the WalkingState asset, but I can't. They don't pop up when I press the little circle on the right to open the searching window, and I can't drag and drop them since I can't have the WalkingState asset and my player character opened in the inspector at the same time.
So does anyone know how I can assign my player components to these?
You can open two inspector tabs (using the Window menu) and lock one of the tab using the little lick icon (in the top right corner of the tab).
Keep in $$anonymous$$d that in your Scriptable Object, you won't be able to assign GameObject living in the scene, only GameObjects which are prefabs (living in the project)
Your answer
Follow this Question
Related Questions
Scriptable object variable not updating when changed, only when game stopped 1 Answer
Keeping variables between scenes with scriptable objects? 0 Answers
Do i need to create a "current value" for those private variables? 0 Answers
Show multiple attached scripts variables in one script in the inspector 0 Answers
Help with scriptableobjects 1 Answer