- Home /
Unity auto unassigned skinned mesh render variables on Play
Hi, I have a variable "skinnedMeshRenderer", and I clicked the circle on this variable in the inspector of the object with the script,. When ever I click the play button the skinned mesh renderer from the slot just switches to none and unassigns itself, I can reassign them (still in play mode) and then they stay but only for that session. When I stop the game and then click play again (to reset the scene) they unassign again. For right now it isn't a big deal, just a little annoying, but whenever I build the game this issue will be unfixable. Please let me know how to fix this, or if there is a line of code similar to GameObject.Find, I already tried and looked for SkinnedMeshRenderer.Find("");, but that doesn't work, thanks.
Answer by pandatree12 · Mar 30, 2017 at 11:39 PM
I figured it out myself, what you have to do is have a variable find a gameobject with the name of the object the has the skinned mesh renderer, then have another variable that = .GetComponent(SkinnedMeshRenderer);
Could you explain this a little more clearly im having the same issue.
Your answer
Follow this Question
Related Questions
Why Does Adding to My SyncListStruct Break SyncVar? 0 Answers
Problem with variables,Problem with identifying a variable 2 Answers
How to increase score for objects that form larger geometries? 0 Answers
What makes a prefab alter their variables at runtime? 2 Answers
Field Initializer Error 1 Answer