playMaker

Author Topic: Getting fsm off external hard drive  (Read 1119 times)

misterjuly

  • Sr. Member
  • ****
  • Posts: 357
Getting fsm off external hard drive
« on: October 01, 2022, 06:31:37 PM »
Hello,

I have a back up of my unity project and in my actual project I have made changes to one particular FSM that I regret. Is it possible to get the single fsm off my external hard drive? I don’t want to get my whole project off as I will lose stuff I made that I like. I am working on a Mac with time machine. Thanks!

John Bassi

GMPlay

  • Playmaker Newbie
  • *
  • Posts: 28
Re: Getting fsm off external hard drive
« Reply #1 on: October 02, 2022, 05:55:24 AM »
There could be many ways of doing it. I haven't tested any of it though  :P

But before you try any of these please make backups of your backups plus backups of your working folder  ;D

I hope the clip-board supports copy pasting fsms across instances of unity. In theory it should work.

One possibility is to rename and copy your project (with good fsm) to your local hard-drive. Then use Unity hub to add this renamed project into the project list. Open this project. Keep it open.

Now also open your actual project (one with bad fsm) in the second instance of Unity.

Switch to renamed project and then Right click on the good FSM component in the inspector and select copy component.

Now switch to actual project and then right click on any component (transform for eg.) of the corresponding game object where the FSM should belong. Choose paste as new component. (remove old fsm first)

Alternate method would be to directly select all the states in the FSM editor and copy paste them across projects. As long as you haven't made any complex changes that involves dependencies across other fsms you should be good.

More simpler way could be to right  click in empty space in the fsm editor and choose copy fsm. Then paste it in the corresponding spot in the working project.

Other possibilities would be to save the good fsm as a template may be. I haven't used templates but that should work provided it is done correctly.

If for some reason you can't open multiple instances of Unity, then I suppose you could open them one by one and hope that the clip board retains copied data.

Finally , you can turn the game object with good fsm into a prefab if it isn't already.

Place this prefab into your work project wherever you see fit. Unity should update its meta. Then delete the game object with bad fsm and replace it with this prefab. Unpack prefab completely if you want or stick to prefab (depends on your use-case) . Make backups before you try this one!
« Last Edit: October 02, 2022, 05:58:39 AM by GMPlay »

misterjuly

  • Sr. Member
  • ****
  • Posts: 357
Re: Getting fsm off external hard drive
« Reply #2 on: October 02, 2022, 11:04:48 AM »
I was able to remember the changes I made, so I didn't need any of these suggestions. But thanks for them though! I'm sure they will be useful in the future!