- Home /
Need help in making my plane to do Yaw
This is what I have wrote to tilt my airplane while going left and right values of variables used in script after trial and error are
(i.e. its doing Rotation but not yaw ...I want to do Yaw also )
public float _y_movement= -1.0f; public float _z_movement=-1.0f; public float _rotateSpeed=0.05f;
Quaternion temp_rotate0 = new Quaternion(0.0f, (Input.GetAxis("Vertical") / 4) _y_movement, (Input.GetAxis("Horizontal") / 4) _z_movement, 1.0f);
transform.rotation = Quaternion.Lerp(transform.rotation, temp_rotate0, Time.deltaTime * _rotateSpeed);
With this My plane is doing tilting to left and right But I want my plane to even face left nd right little bit respectively i.e. I want my plane to do yaw
So what should i add to this to make it doing Yaw ?
Are you assigning your aircrafts rudder input to do yaw? Input in an aircraft's rudder causes the plane to yaw i.e rotate around its y-axis. Yaw is a rotation essentially.
Answer by Silencerx · Sep 22, 2011 at 09:14 AM
woa woa woa, why not just make an animation, when you push left play the tilt left animation.
this method even allows for easy tweaking
if your going to animate please note that you will run into troubles if your animated object is not parented to a null object(dummy box) plus it's alot easier to work with as during an animation the rotation of an object seems to be taken very literal, not allowing for rotational changes unless done on a parent
I am not able to animate $$anonymous$$...is there some tutorials where i can see how to this tilt left animation stuff or sort of same...
well if your using 3ds max it's really easy just set auto key and tilt the plane left and right at the correct key frames, if your using blender or something else i have no idea how to animate in them.
you can animate in unity, i would find a tutorial as i usually animate in max and am novice, but i would imagine
link your plane to a empty game object if not already
at the uper right of the scene/game window there is a tab options button it looks like 3 horizontal lines, click it
add an animation tab
click the red dot at the top of the animation tab to record your actions (it will prompt you to save the animation, do so in your plane dir)
add a keyframe at frame 0(button is to the right of red record button)
more the slider to frame say 10 then
in scene view tilt your plane left how you want
move the slider to say frame 30 and add a keyframe so that the plane holds the tilt for a bit
move the slider to frame 40 and reset the rotations of the plane(should add a keyframe)
you can right click keyframes and choose the options to smooth out the animation
repeat for the tilt right(you may want to copy values that are next to the rotation axis in the animation tab, just slide to the apropriate frame copy and invert the value in the right tilt)
you now have 2 animations on the plane, just refer to the unity script reference site on how to use them
note: i have had problems using unity's animation with it using absolute values and not relative ones, so my object snaps back to where i animated it, i assume parenting the object would alleviate this problem, i have not tested so try at your own risk
does that really work?, last time i tried something similar i couldnt import it because it classified as vertex animation
yea, i don't even think unity supports vertex animation unless by skinned bones or custom code, atleast from my experiences, I did make a door concept using this similar method and have used unity anim before
Thanks $$anonymous$$ ... Let me try this today ...get back to u soon...
Your answer
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Problems with scripts 0 Answers
Building system 0 Answers
C# code to Java code 1 Answer
How to toggle a key for a car to go forward or backward? 1 Answer