- Home /
WrapMode option not available in unity 4.3?
Hi
I am new to Unity. In Unity 4.3, there is no option for setting the wrap mode to ping pong. The option was present in previous versions in the inspector. How can i set wrap mode to ping pong ?
Answer by Kumo-Kairo · Dec 12, 2013 at 01:46 PM
It's in the properties of the object with the animation component. Don't forget to turn on Debug view:
your second screenshot (not visible, have to click the link) is most informative, as it shows how to get to debug mode. Thanks, I can't imagine why they made these changes to the animation system and stuck this fundamental feature under "debug", which is accessible via a 10 pixel high button.
edit: actually even when I set the animation to ping pong, as per the second screen shot, it never ping pongs. Wrap $$anonymous$$ode is never listed as an option as per the first screen shot. When you drag the animation asset to the joint it creates an "Animator" component ins$$anonymous$$d of "Animation"
edit 2: If you try to simulate ping pong using the animator it for some reason has inconsistent ti$$anonymous$$g when it loops, lurching ahead in the animation after the repeat. If you add an animation using add component and then add the animation that way, you can set the wrap mode as ping pong but it doesn't actually do anything
You now have to go into Debug mode on the animation clip and set "Animation type" from "2" to "1".
(obviously, right?)
Answer by JimboFBX · Dec 18, 2013 at 03:23 AM
Alright, posting as a new answer so we have a clean reference for the Stealth tutorial:
First off, create the animation cctvSweep as per the video.
Next, select the object you are animating (in the case of the Stealth tutorial, it's prop_cctvCam_joint), and click on Add Component, then Miscellaneous, then Animation. Note that if you click and drag the animation onto the object in the Hierarchy like what is shown in the video it will create an Animator component which is not what we want.
Click and drag the animation file from the Project view into the Animation field in the Animation component. Set wrap mode to PingPong, then double click the animation field with the Animation window already open. This should also open the animation in the inspector
In the top right where the Inspector tab is located, click on the tiny box next to the lock and change "Normal" to "debug". The image Kumo-Kairo posted in his answer shows how to do this
Change the Animation Type from 2 to 1. You can also change the Wrap Mode to PingPong here as well.
Set your animation as normal in the Animation window, and it should now ping pong when you test it
Thank you for this answer, works perfectly for me. I'm guessing Unity really does not want us using the legacy system if doing something this simple is such a problem...
Thank you for this answer, I can go on with the tutorial now.
Answer by ShawnFeatherly · Feb 10, 2014 at 08:58 AM
If you've created an animation using the Animator window, find where you saved the *.anim file using your Project hierarchy window and select it. Then check Loop Time in the inspector for ping-pong.
Answer by Volts · Aug 13, 2014 at 06:44 PM
The instructions by Greg Brown on Youtube worked for me:
"For anyone struggling with the animations in Unity 4.5 here is an easy way to do it (avoiding the legacy problem):
Before you create the CCTVSweep animation file, open up the animation window under the window tab (not the animator window). With the camJoint child object selected, click add Curve in the animation window. Navigate to the animations folder and save your file there as CCTVSweep. (I don't know why that would make a difference but it stopped the legacy warning coming up for me.)
You can click add Curve again and select Transform > Rotation. This will give you an animation clip. You can expand its properties using the drop down arrow to the left of the clip and its rotation.y you want to be working with. You can pretty much follow the tutorial from there. (I made a 16s clip, with keyframes (time,rot.y): (0,60), (8,0) and (16,60) to create the panning.)
Also for people complaining about not having the ping pong feature you can simulate the smooth motion by going into the curves tab, and right clicking on the start and end key frames and selecting "free smooth". You can grab the key frame and fashion the curve into a cosine wave. (y) "
Answer by Morganstudios · Oct 04, 2014 at 06:59 AM
Ok, I've finally got the animation thing figured our for this tutorial with Unity 4.5. Here's what I learned.
Summary: The new animation system as of version 4.3 is different. You can either try using the old legacy system(most advice you'll find is for that) or you can make the same behavior with the new mecanim system.
Old Legacy System: Create an animation object(cctvSweep) like they say. There are three small lines at the top of the inspector. You can click that and go into debug mode. This is the only way to unlock making new oldstyle animation object. You can still import existing old style animations, but we are creating one from scratch. Once you are in debug mode, you can change the animation type from 2 to 1. Then you can switch Wrap Mode to "Ping Pong" since it won't be available where it was in older versions of Unity. To attach the animation to the script, select the joint and add a component (Misc-> animation) and then drag your animation to the animation edit box rather than dragging to the tree, because with the 4.3/4.5 it will create an Animator object instead, which is part of the new system. When you go to the animation window, there won't be all the curve types listed in the dope sheet like in the video. Click "Add Curve" and select Transform->Rotation. A second keyframe is already there, just set it like he does in the video. For some reason the curved lines aren't actually showing in the gui, but you'll see the light animate in the scene window if you hit play when you are done.
New MecaAnim System: The new system is very focused on rigging but you can do simple transform type animations as well. Create a new animation like the tutorial says, and if you had been playing with debug mode to get the old system, make sure it's a type 2 animation otherwise just disregard. Check "loop time" to make it a looping animation (like Ping Pong sort of). Drag ccTVSweep to the joint hierarchy item and it will create an Animator object. Go to the animator window like the tutorial says and you will see the various curve types are not shown on the dope sheet like in the video. It's ok, click add curve and select transform->Rotation. To get things working smoothly you'll need to animate it going from 0-60 degrees and back instead of using Ping Pong like the video says...at least I haven't figured out how to get that work anyway... So 0-60 in 2 seconds, then 60-0 from seconds 2 to 4. Right click the keyframes and choose "flat" so it doesn't have strange speed changes. For some reason the curved lines aren't actually showing in the gui, but you'll see the light animate in the scene window if you hit play when you are done. I'm not sure how using the new system affects later tutorials, but it seems good at this point.
Your answer
Follow this Question
Related Questions
Animation wrapmode in mechanim? (hip rotate and stay) 0 Answers
Cannot create 2D object with repeating texture 0 Answers
Unity 4.3 Facebook SDK BUG? 0 Answers
How to get child sprites from a 'Multiple Sprite' Texture? 5 Answers
upgrading to Unity 4.3 was a terrible mistake? Can't find the issue. Please help! 2 Answers