- Home /
Script not applying to imported Blender Model
Go easy on me, I have only been working in unity for a couple weeks now.
I have it where when a game object has a script I made applied to it, the object can be attacked then destroyed. This works. So for example I can make a sphere, apply the script, my character hits it, and the sphere disappears.
When I import say, a blender model of a snake I made, The script no longer works and I can not destroy the snake.
I do get the error "The hull has more than 255 polygons" or whatever from unity when i import my snake, is this causing the problem? How do I fix this So I can attack my model and it disappears?
Thank you!
Answer by Mozaih · Aug 07, 2013 at 09:34 AM
I dont think the blend file is the problem but why dont you try to export it as a Wavefront model(obj)
File>Export>Wavefront
I tried to export as wavefront, It still didn't work.
I know when I import my blender model in unity (its a snake), Unity can not create any colliders for it becuase it has to many polygons. So doesn't that mean there is nothing for my character to hit in the first place?
$$anonymous$$aybe I need set up a basic collider like maybe a sphere to put around the snake? but then how would the script work? I would still want my snake to disappear when hit but the script says destroy.gameobject and im not sure how to make this work for the snake.
like I said I can destroy gameobjects with my script, but when I import a model it works different, can someone help?
Answer by meat5000 · Aug 10, 2013 at 01:53 AM
Export from Blender as .FBX Autodesk. I love Blender and this way works for me.
Dont use mesh colliders but instead use primitive colliders. 10k triangles is fine for a model. 255 is a joke.
Destroy.gameObject will destroy whatever object that particular script is attached to.
Hope this helps.
You are welcome to DropBox your Blend file if you want me to try it myself. Also, post your script, let's 'ave a look.
Your answer
![](https://koobas.hobune.stream/wayback/20220613111707im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
How to Change Parenting while in game? C# 1 Answer
About Destructible 3d objects 1 Answer
Help with my first fbx model in Unity via Script! 0 Answers
How to form copies of yourself that follow you when you walk? (2D Platformer) 2 Answers