Log in or register to post comments

Maintaining the size ratio

May 24, 2014 - 8:39am #1

I am making a game which involves some augmented reality using Vuforia.
My game is a basic 2-D platformer currently having 2 scenes. Scene 1 just has a movable character,jumping from one platform to another. It works perfectly.

Scene 2 is just the copy of scene 1 except that it involves augmented reality - it tracks the marker and then spawns my player and detaches it from the marker gameobject,making it independent gameobject.

Now the problem that i am facing are:

  1. In scene 2 player is not jumping or running the same distance it does in scene 1, making my designed level useless- i can not reach other platforms.( i think i need to shift from ar camera's coordinate system back to unity's coordinate system- i don't know how to do this.)

  2. I am having a hard time getting the spawned player to be of the same scale it is in the other scene(I know it has got to do with the distance at which the target is detected but don't know how to handle this and change its scale to normal).

Any help is appreciated.

 

Maintaining the size ratio

May 28, 2014 - 11:19pm #3

I figured out the problem. It had nothing to do with size,scaling etc. The problem was with my scene setup.

Maintaining the size ratio

May 28, 2014 - 7:05pm #2

This sounds like an issue with parent-child scaling. In Unity a child's scale values are changed to reflect its ratio to the scale values of the parent. If there's any behavior dependencies on the child's original scale values, you could see different results. One way to preserve a child objects scale values is to parent it under an empty GameObject which is then parented to the scaled object (i.e. Vuforia target).

Log in or register to post comments