Log in or register to post comments

User Def Target Unity Extension animation issue

February 17, 2013 - 7:29am #1

Hello,

first I'd like to say a big thanks to the Vuforia developers! Your software is awesome.

I couldn't find a similar topic here, so I'm creating this one....

I'm using Unity 3.5 with vuforia 2 extension to build for IOS. I'm having an issue with user defined targets. I want to animate the 3D models that are displayed on the udt(various animations triggered by buttons). In the Unity Editor (play preview) it works fine, also with image targets it works on the iPad. But as soon as I try it on the iPad with udt(=user defined targets), the buttons don't work. The 3d model is displayed but pressing a button has no effect. (my models are linked to a parent dummy obj, which is linked to the udt; but that hierarchy is no problem with image targets...) Any ideas what might be the issue would be greatly appreciated.

Thanks in advance for your efforts!

User Def Target Unity Extension animation issue

March 10, 2014 - 6:47am #12

Try to debug by looking at the value of this variable in your code:

hit.transform.name

you should be able to see if the objects are hit, or if something goes wrong; I cannot debug your application for you, but my best sugegstion is to print out as much information as you can to the Logs, and check if any erratic situation appears.

 

User Def Target Unity Extension animation issue

March 10, 2014 - 6:37am #11

hi alessandro,

 

I am sure its getting ran in unity editor but it is not running in android phone.Only thing I can able to drag the 3d model.But I can't animate them.

I am using legacy mode.

wrap mode = loop

added box collider to 3d model for raycasthit.

not even change the material for 3d model

I have structure like 

----->UserdefinedTarget

       ---->MovementAnimsetProLite ---(model name) in this model having   DummyMESH,Root   like wise goes

How can I find the game object in my own script?

is there any script to modify to succeed animation play...

Please help me for this issue.

 

 

public class TouchToMove : MonoBehaviour 
{
	public GameObject enemy2;
	public Material newmat;
	public Material oldmat;

	private bool mSwapModel = false;

	void Start()
	{
		enemy2.animation.Play("ButtonPush_RH");
	}
	void Update () 
	{
		if (Input.GetMouseButtonDown (0)) 
		{
			Ray ray = Camera.main.ScreenPointToRay (Input.mousePosition);
			RaycastHit hit;
			if (Physics.Raycast (ray, out hit))
			{
				if(hit.transform.name == "MovementAnimsetProLite")
				{
					
					print ("name --->"+hit.transform.name);
					if (mSwapModel) 
					{
						enemy2.animation.Play("ButtonPush_RH");
						mSwapModel = false;
					}
					else
					{
						enemy2.animation.Play("JumpIdleLand");
						mSwapModel = true;
					}
				}
				if(hit.transform.name == "teapot")
				{
					GameObject.Find ("teapot").transform.renderer.material = newmat;
					enemy2.animation.Play("JumpIdleLand");
				}
				else
				{
					GameObject.Find ("teapot").transform.renderer.material = oldmat;
					enemy2.animation.Play("ButtonPush_RH");
				}
			}
		}
		if (Input.GetKeyUp (KeyCode.Escape)) 
		{
			Application.Quit();
		}
		
	}

 

 

 

 

User Def Target Unity Extension animation issue

March 10, 2014 - 3:11am #10

Hi NagarajUnityDev,

not sure what is your exact script logic and scene setup, but I seem to understand that you are trying to control an animation from some buttons, on a 3D model attached to the UDT;

a few things to verify are:

- is the button click actually triggered (put some debug message and check the logs, upon clicking the buttons)

- is the 3D models found by your script at runtime ? (again, here you need to debug and verify if you are getting any null pointer / null reference or other error in your logs)

Also, consider that UDT are instantiated at runtime, so, this means that you cannot rely on targets in the Scene, as at runtime you will be handling a different instance of the target; so, something to keep in mind too.

 

User Def Target Unity Extension animation issue

March 10, 2014 - 3:00am #9

Hello,

first I'd like to say a big thanks to the Vuforia developers! Your software is awesome.

I couldn't find a similar topic here, so I'm creating this one....

I'm using Unity 4.3.3 free version with vuforia 2 extension to build for android. I'm having an issue with user defined targets. I want to animate the 3D models that are displayed on the udt(various animations triggered by buttons). In the Unity Editor (play preview) it works fine, also with image targets it works on the android. But as soon as I try it on the android with udt(=user defined targets), the buttons don't work. The 3d model is displayed but pressing a button has no effect. (my models are linked to a parent dummy obj, which is linked to the udt; but that hierarchy is no problem with image targets...) Any ideas what might be the issue would be greatly appreciated.

Thanks in advance for your efforts!

User Def Target Unity Extension animation issue

February 22, 2013 - 11:57am #8

Those are good tips cap10subtext.

Can someone PM me w/ a link to an affected project? I'll need to look into this.

User Def Target Unity Extension animation issue

February 22, 2013 - 9:09am #7

Hello, I can also confirm now that my button is firing, animation is just not playing. In Unity play preview it works but not on the ipad......

User Def Target Unity Extension animation issue

February 20, 2013 - 8:53am #6

Just a few Troubleshooting suggestions (I'm no expert on 3D model animations):

1.  I've often seen people try and use animations on a marker that seem to play in the Unity Player, but the issue is that the animation you want isn't set to loop (in the model properties), so by the time the marker is tracked the animation has played through.

2.  I'm not sure what effect of the DefaultTrackableEventHandler has on an animation, but it's worth checking if the sequence which disables the renderer is preventing your animation from playing through.  I'd decided which you want (your animation to play from the beginning or playing through regardless of tracking) and coding that explicitly in the TrackableEventHandler.

3.  Another issue I see frequently is that the code to begin the animation is passed to Update without defining an isPlaying (or equivalent) so the animation keeps starting over from the beginning (which gives the appearance of nothing happening).

Not sure if these are helpful but they sprung to mind...

User Def Target Unity Extension animation issue

February 19, 2013 - 9:48am #5

Hey, I can confirm. I got the sample User Defined Target unity sample project and when I import a sample fbx animation it simply refuses to play-it.
I am almost sure is not a button issue since I am trying to trigger the animation via a WaitForSeconds call... So no buttons of any kind involved here.

Any suggestions? :)

Thank you!

User Def Target Unity Extension animation issue

February 18, 2013 - 12:20pm #4

Please report back when you've confirmed that. Also is this using an original UDT scene, or have you adapted your scene from the UDT sample?

User Def Target Unity Extension animation issue

February 18, 2013 - 12:31am #3

Hello David, thanks a lot for your reply!

I'm using GUI buttons on the device screen, no virtual buttons.

I haven't logged(gonna try it)- but I'm quite sure they are firing. As I link the 3d objects to an image marker in the same scene everything works fine. So the buttons  must fire.

User Def Target Unity Extension animation issue

February 17, 2013 - 4:45pm #2

Are you using Virtual Buttons or GUI buttons on the device screen? UDT targets don't support Virtual Buttons - https://developer.vuforia.com/resources/dev-guide/virtual-buttons, see the note.

Have you attempted to log the button event to determine if they're firing?

Log in or register to post comments