- Home /
Can't skew a gameobject transform?
I'm trying to port an existing game from a custom iOS engine to unity.
However, all the objects in the game use a little bobby animation that relies on skewing the objectToWorld matrix. Bascially, the y axis bobs up and down, and a little left and right on a little sine wave, while the x and z axis remain static.
I can't see how to do this in Unity with its limited transform system only supporting rotate, translate and scale.
The best solution I have come up with so far is to do the skewing in the vertex shader, and handling my own attachment code for child gameObjects (like gun turrets or particle systems). That is, I can't make the a particle system a child of the parent, since the pivot won't animate with the parent's skewing.
Perhaps I've missed something and there really is a way to create a skew'd transform??
I can't see anything to suggest that iTween can skew a transform
It can't skew it - only modifying the mesh (or doing it in the shader) will give you the effect - as you rightly say, that doesn't solve your problem with the particle system.
Perhaps $$anonymous$$egafiers? Still not sure it's going to help with the particles.
that looks pretty impressive, but overkill for what I want, and pretty sure that it won't help with child attachments. I have the shader version working fine, so really just wanted to know if there was an alternative that worked with child attachments.
Answer by whydoidoit · Jul 13, 2012 at 05:21 PM
From everything I can see it is not possible to create a matrix which is applied by Unity. The matrix that you can access in the transform is calculated from the basic transform elements meaning that you can't apply shear/skew.
thanks. I just wanted to get some confirmation I wasn't going crazy. sigh. I might try and see how the game looks with some bouncy scaling rather than skewing.
Answer by Piflik · Jul 13, 2012 at 05:43 PM
While you probably can't skew objects directly in Unity, it would be possible to import animated objects. It's more of a workaround, than a solution, though.
thanks for the suggestion, though the shader solution I have works fine as a workaround. I haven't touched Unity's animation pipeline yet. Even my models are dynamically generated at runtime from scripts.
Your answer
Follow this Question
Related Questions
Instantiate rigidbody, transform or gameobject? 1 Answer
I want to move a cube with rotation but I find this problem 1 Answer
Is there any way to convert Collision to a Gameobject or Transform? 1 Answer
Difference between Vector3, Transform and GameObject 2 Answers
How to move a gameObject without affecting its childrens' positions? 2 Answers