Type mismatch, prefab into scriptable object
Asked Answered
O

2

0

Hello everyone,
I have a hard time to understand this “problem”.

In my game I am trying to use prefabs with ScriptableObjects (data containers) and while I mostly use simple data type such as string,int,float or Vector2Int etc …
In one situation I created a ScriptableObject of type GameObject called current Map. I drag and drop a prefab of one of my maps into this slot (without any error) and later when it comes to switching levels, I create an instance of another map-prefab and try to store it into my Scriptable object current Map (also without any error).
It seems to work, but when inspecting the ScriptableObject - the serialized field (where the prefab instance should be displayed) just displays type mismatch.

I guess I still have a very basic misunderstanding of this topic… or do instances of prefabs have a different type than GameObject? … please share your thoughts!

Thanks and best regards,
Markus

Oxidation answered 30/6, 2023 at 18:42 Comment(0)
O
0

Anyone with helpful insights out there?
thanks!

Oxidation answered 6/1, 2022 at 1:14 Comment(0)
F
0

@Oxidation very late to this party, but did you ever figure this out? I’m up against the same issue.

Edit: I just figured out my problem. I kept selecting a prefab from the scene, it should be a prefab from the assets folder. Whoopsiedaisy.

Falsify answered 30/6, 2023 at 18:3 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.