1-I am making a small app in 3d mode for android using blender and unity.
2- I made rigged character with an iddle animation and a happy animation in blender.
3 -I imported it correctly into unity. i put the bool parameters in the unity animator and all works fine, even tested on the phone.
Problem:
I cant find a good tutorial to create the interaction(code) between the animations and the touch screen event.
hope you can understand me. Thanks in advance!
If I understand correctly you want to transition from Idle to Happy Animation on the touch of a button and you said the animation is not a problem.
Since you have not provided any code I can tell you the algorithm.
In update check whether someone is touching the screen.
Then check if the phase of the touch is "began".
If someone is touching the screen, use the Animator.SetBool() function to set the boolean for the animator to true.
Setting it to true will transition it you have set the transition condition to the above mentioned boolean.
Use the Unity Scripting Reference to understand the touch functions better.
Unity Touch Scripting Reference
And I would recommend watching this Animator Controller Tutorial to learn about it.
Related
Im using bêziers path not vertex one. And in editor(windows) there is
no problem with it. im building for android and trying to play with
galaxy m21. first scene is completely normal. but when it comes for
other scenes it start moving laggy (because of path follower i think).
(im not talking about side walks just movement to forward along the
path)
there is 4 scene and this is looping when click next level in the end.
if we return to first scene that one starts to laggy movement.
game is a little city we move in streets so i was thinking maybe
render based problem so i delete every gameobject about city it became
almost some kind of empty space and tried, same problem.
also i was using different gameobject to follow pathfollower so i
remove that and put my player directly inside pathfollower but it
remains same. when i go next level it starts moving laggy not smooth.
(i understand it because there is trail and shaking time to time)
finaly i add game manager's awake() System.GC.Collect();
Resources.UnloadUnusedAssets(); maybe it helps when nextlevel loaded.
but still it is laggy forward movement.
any idea what is going on? i can take any suggestion thanks for help.
i just find it i was using Dotween for side movement but it was using x,y and z That was my problem.
I dont know how it works when its first loaded. I mean if i load the game and play it works first level but other levels starting >
-sorry i dont know exactly word but its lagging/freezing in the movement.-
But if i close app and start again, that same level works just fine.
Anyway i just tried to disable that script at tried and i see no shaking/freezing in the trail so, i think that was the problem, thats my fault i think like i said, i'm new :)
now i try use tween except the z or try completely diffrent thing.
I made an 2D animation on Photoshop and I'm building 2D interactive novel for Android. I added 16 images to my scene and named it Myanimation. I need to play this animation after 10 secs from beginning. So I need to set Legacy on from Myanimation's debug menu. But when I click Legacy's box Myanimation's size in "Pptr Curve Mapping" changing to 0. And my animation doesn't play. (I think the problem is this. Coz If I try working with only 1 image and build moving animation it works.)
Anyway I am adding Animation (Add component-> Miscalleneous -> Animation) and adding Myanimation in it. And build a script like that
function Start() {
Invoke("Ersakonus", 1);
}
function Ersakonus() {
animation.Play("Myanimation");
}
But when I play the game (Novel) it doesn't work. I need this coz I need to let other character's animations one by one while they are talking with Invoke.
Can you plase tell me how can I fix this issue?
Let try Animation.CrossFade
https://docs.unity3d.com/ScriptReference/Animation.CrossFade.html
And then check your animation component have animation named or something but If u want Novel unity game take a look.
https://www.assetstore.unity3d.com/en/#!/content/9416
I am creating an android game in libgdx engine.My Animation object and rendering code is as
rightAnim=new Animation(0.02f, rightRegions);
rightAnim.setPlayMode(Animation.LOOP_RANDOM);
//Rendering
batcher.draw(rightAnim.getKeyFrame(runTime,true),hero.getX(),hero.getY(),hero.getWidth(),hero.getHeight());
I can see this animation running only on "LOOP_RANDOM" mode, but I want it to play normal loop.In other loop only 1st frame is drawn for eg. in "LOOP_REVERSED" mode only last frame is drawn.I googled 2 days but couldn't find solution.Please help me out and sorry for my bad English .
This:
rightAnim.setPlayMode(Animation.LOOP)
is the correct play mode for a standard animatin loop, and should give you the behavior you want. If that is not working, something is probably wrong with the time ranges you are using.
Try increasing the frameDuration argument from 0.02 to 0.20 and see if you can at least see your animation play through correctly (if slowly).
Also, make sure your rightRegions list is correct.
Finally, what is your code for updating runTime? Make sure that is changing correctly.
Is there any way to create a 360 degree object view from photos? I have a set of 71 photos of a single car viewed from different angles. I want to combine them and be able to rotate the car when touching the screen seeing it from different angles.
I've done researching but I couldn't find anything done in android. One example is found here
This example is made with Jquery. What I need is to implement it directly inside an android app. How can I do this?
Edit1: Until now I managed to create an animation between images in this way:
The problem is that the animation starts on click and works by itself. I want to be able to move the car from left to right and right to left when keeping the finger pressed and moving to right or left. How can I do that so I can see the car from the angle I want?
I just tested that Jquery plugin page on my device and it seems to work alright. So you could still presumeably use that plugin to make some html content that you could then load into a WebView. That would give the rotation thing inside of your application.
If you don't want to use html/javascript to do it you'll have to use an ImageView with a TouchListener attached to it that handles the drag events by swapping to the next image at the appropriate interval.
Or probably somehow with Canvas, though I am not as familiar with that, I would knot how to describe what you'd need to do to make it work this way.
After hours of trying to accomplish this task I stopped using the Drawable animation method because at point I was loading the images the app would of crashed because was out of memory.
Instead I found another way to do it which I use it right now. Example
I changed the .html with the images I need and the layout I want then I implement it inside my app using a webview. Is working pretty well.
This is a fairly specific question, but it generalizes to running Webkit transitions that affects more than one property.
I'm trying to use a transition to translate and scale a div in the Android default browser. When the transition ends, the element pops back to its default state. It looks kind of like I forgot to use animation-fill-mode, but on a webkit transition.
The transition is setup to work on -webkit-transform with a translate3d() and a scaleX(). It translates and scales fine, but as soon as the transition ends, it pops back to full size and its "default" position. If I transition on only translated3d or scaleX, it works fine. The webkitTransitionEnd event fires after the "pop-back" so I can't intercept the "pop-back" and override it.
Is multiple properties on a Webkit transition something that is known to not work on Android 2.3? Does anyone know of a working example that I could compare to? Any ideas for workarounds?
Thanks.
I have seen no docs or release note about it, but I know from trial and other posts that many of us have not been able to get multiple animations or transforms to work in any Android < 3.0.
see.
http://daneden.me/2011/12/putting-up-with-androids-bullshit/
and comments on.
CSS3 Multiple transforms