The type gravity behavior is ambiguous,how to solve it

edited October 2013 in Library Questions

The type gravity behavior is ambiguous, I have already import the library verletphysics, but it doesn't work~

Answers

  • Answer ✓

    Hey myj,

    Sometimes when a library uses a class name that other library's also use you have to be explicit when initializing the variable to let Java know what class you would like to use for your object. For example, in your case, you may need to do something like:

    org.verletphysics.Gravity g = new org.verletphysics.Gravity();

    using the same package names as you would use to import it. (i'm not sure what the verletphysics library path looks like)

    Hope this helps! ak

  • edited October 2013 Answer ✓

    ~

  • Answer ✓

    I suggest to reproduce the message exactly as it is displayed...

    See also if the Common issues with sketch names article is relevant...

  • But what the problem is that the library" Verletphysics " doesn't have the packages toxi.physics3d toxi.physics3d.behaviors, where can I download the library that has such packages.

  • It is a bad idea to ask the same question in two different places, so I removed the duplicate post.

    It might help to explain where you got the library, and where you saw the code you are trying to run.

    Note also that "ambigious type" means the class can be found in two places, not that it is missing. So perhaps you have conflicting libraries in your sketchbook.

Sign In or Register to comment.