Mounted Camera Problem
by gigacycle · in iTorque 2D · 05/07/2011 (2:55 am) · 11 replies
Hi all,
I did mount the camera on a bouncy ball, so it works on simulator (camera tracks the ball)! but when I run my game on iPhone, the camera does not move.
This is my code:
I did mount the camera on a bouncy ball, so it works on simulator (camera tracks the ball)! but when I run my game on iPhone, the camera does not move.
This is my code:
if (!isObject(cameraMountBehavior))
{
%template = new BehaviorTemplate(cameraMountBehavior);
%template.friendlyName = "Camera Mount";
%template.behaviorType = "Camera";
%template.description = "Mounts camera to object owning this behavior";
%template.addBehaviorField(offset, "offset of mount x y", string, "0 0");
%template.addBehaviorField(force, "force of mount", float, 50.0);
}
function cameraMountBehavior::onLevelLoaded(%this)
{
sceneWindow2D.mount(%this.owner,%this.offset,%this.force,true);
}About the author
#2
there is no error in log file.
but yesterday I run it on iPhone after deleting dso files and it works fine.
I run that game on iPad and camera not worked there...!
is this a bug?
05/11/2011 (1:02 am)
Hi mark, thanks for your replying!there is no error in log file.
but yesterday I run it on iPhone after deleting dso files and it works fine.
I run that game on iPad and camera not worked there...!
is this a bug?
#3
05/11/2011 (9:21 am)
It *should* work the same on both devices. Are you running a 'Universal App' or two separate projects?
#4
I run two separate projects. I did change product name in xcode "build configuration", but when I run one of them it will replace to another one in my iPad!
I think this is not a good reason for making the problem.
05/11/2011 (8:42 pm)
Yes!I run two separate projects. I did change product name in xcode "build configuration", but when I run one of them it will replace to another one in my iPad!
I think this is not a good reason for making the problem.
#5
05/11/2011 (8:55 pm)
Have you tried mounting the camera during the gameplay as a test? I noticed you are mounting the camera on 'onLevelLoaded', which is called right in the beginning. For me, if I try to mount an object in the very beginning, it often fails. Try mounting the camera during the game and see if that works. If it does, then wait a little while after the level loads before mounting the camera.
#6
but why it works on my simulator completely (not randomly)? it works on my iphone too! I think this is not coding problem.
05/11/2011 (9:04 pm)
thank you Richard!but why it works on my simulator completely (not randomly)? it works on my iphone too! I think this is not coding problem.
#7
05/11/2011 (9:05 pm)
Did you clean the .dso files in BOTH projects? Maybe you only cleaned one of the two projects?
#8
05/11/2011 (9:13 pm)
yes I did clean the .dso files in both projects by "cleandso.command"!
#9
05/11/2011 (9:16 pm)
Sorry to be redundant, but I want to make sure. You ran cleandso.command twice, right? There is a cleandso file in both projects' profileFiles folder.
#10
let me know how can I have two separate torque project icon in my devices?
05/11/2011 (9:19 pm)
yes, sure! let me know how can I have two separate torque project icon in my devices?
#11
05/15/2011 (8:14 am)
@gigacycle - I have sent you an e-mail regarding licensing and your issues for this thread. It is very important, so please reply ASAP.
Torque Owner Mark Grossnickle
1. Do you get any errors in the logs when on the iphone?
2. Have you cleaned .dso files and run the simulator version before putting on your phone? Sometimes code lingers and doesn't update like you would expect... er at least how I would expect. ;)