- Home /
Get object/prefab name as string.
Im trying to do a map editor and when you save its saves every object x,y,z value but wanna get the first three charters on the object name for id. When i load the map im gonna check the id and spawn the prefab on the x,y,z position. example
001_BigEnemy //i wanna get 001
002_SmallEnemy //i wanna get 002
plz answer or come up with a better solution.
Comment
Best Answer
Answer by Bryan 4 · Apr 07, 2011 at 06:33 PM
if you have ###-Name, you can easily do a string.split on "-" which will give you 2 strings in an array where index 0 is the ### and index 1 is the Name. Then you can do a parse on the ### from string to get a true number if you need to.
ok thanks but is there a way to get the name of the prefab as a string