Giter Club home page Giter Club logo

Comments (7)

mikemahoney218 avatar mikemahoney218 commented on July 21, 2024 1

Yeah, I apologize -- unifir is not really meant to be used directly, but rather to prop up things like terrainr and an unreleased forest rendering project I'm working on. That means that the docs aren't exactly great for interactive use; they sorta assume users will use one of those not-released projects instead.

That said: In a new session, does find_unity() return the correct path to your Unity installation? It looks like action() ran successfully on your computer (though Unity itself failed, hence the error message -- that error code is literally the only output Unity returns when run via CLI, which is a pain), which means instead the issue is with the example.

from unifir.

mikemahoney218 avatar mikemahoney218 commented on July 21, 2024

Thanks for the report!

Sorry, this package is primarily tested on Linux and Mac, which means I forget about things like Windows file paths typically having spaces in them.

Any chance you can install my attempted solution and tell me if this fixed things?

remotes::install_github("mikemahoney218/unifir", "fixes")

from unifir.

SbastianGarzon avatar SbastianGarzon commented on July 21, 2024

Thanks !

Now I'm getting this:

unity_version()
Error in system(paste(shQuote(unity), "-version", intern =TRUE):
'"C:Program Files/Unity/Editor"' not found

(Seems better but still not finding Unity)

I changed the unifir_unity_path variable to file.path("C:","Program Files","Unity","Editor","Unity.exe") and it seems to be working (kind of).

start_unity <-Sys.time()
unity_version()
character(0)
end_unity <- Sys.time()
Time difference of 12.29863 secs

After using the unity_version() command, the Unity Hub application opens in my computer (good sign ?)

However this happens as I tried your example:

script <- make_script(project="myproj")
script <-add_default_player(script,x_position=10)
script <- add_light(script)
action(script)
Error in action(script): 1

I might be missing something obvious about what to do with the unifir_unity_path option. I'm also having a similar problem with Mac to connect to Unity, so that's why I tried windows.

from unifir.

SbastianGarzon avatar SbastianGarzon commented on July 21, 2024

I'm going to close this issue. The "finding Unity on Windows" problem is actually fixed. The new error might not be related with finding Unity.

For example this works:

script$script_name
[1] "HappenGoneSteadPath"

from unifir.

SbastianGarzon avatar SbastianGarzon commented on July 21, 2024

No problem. I'll patiently wait for the new release 🌲🌲🌲 ! I'll try terrainr to see if I manage to create an Unity project.

Here is the output in a new session:

find_unity()
[1] "C:/Program Files/Unity/Editor/Unity.exe"

When I run action() some folders/files are created before failing 🤷‍♂️:
Assets, myproj,Library, ProjectSettings and Temp.

from unifir.

mikemahoney218 avatar mikemahoney218 commented on July 21, 2024

So far you've helped me fix three bugs, thank you 😄

The proximate issue here is that add_default_player() didn't import a C# library it needed, which means it failed immediately. This is now fixed on the fixes branch, and will be headed to CRAN in the immediate future (because I need to cut a release soon to fix #12 anyway).

There's one other bug in the example: you need to call save_scene(), and probably want to call set_active_scene() afterwards, in order for your changes to appear once you load Unity. Otherwise the unifir script will make all your edits, and then not save any of them. I'm going to open a new issue for a documentation refresh; hopefully I'm able to make the new user experience for unifir itself better in Q1'2023, while also providing more easy-to-use front-ends like terrainr.

from unifir.

github-actions avatar github-actions commented on July 21, 2024

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.

from unifir.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.