Camera Rotation & Character Position
synergy88studios
Member, PRO Posts: 23
Hi GameSalad Community,
I need your help on this project. I want to create a rotating circular world with the character on top. I created a rotating world already using Change Attribute:
where:
Every = 0.001
{
(Change Attribute)
scene.Camera.Rotation = scene.Camera.Rotation +2
}
Everything is rotating. I made the camera rotate instead of the objects because it will be easier for me to create behaviours (like up and down behaviour, etc..) without adding a rotation behaviour to each actors and could cause complexity.
My problem is, I want the main character to retain its position at the top and not be affected by the camera or somehow change its position at the top.
What could be the possible solution for this?
Thanks!
Best Regards,
Synergy88Studios
I need your help on this project. I want to create a rotating circular world with the character on top. I created a rotating world already using Change Attribute:
where:
Every = 0.001
{
(Change Attribute)
scene.Camera.Rotation = scene.Camera.Rotation +2
}
Everything is rotating. I made the camera rotate instead of the objects because it will be easier for me to create behaviours (like up and down behaviour, etc..) without adding a rotation behaviour to each actors and could cause complexity.
My problem is, I want the main character to retain its position at the top and not be affected by the camera or somehow change its position at the top.
What could be the possible solution for this?
Thanks!
Best Regards,
Synergy88Studios
Comments
(Change Attribute)
scene.Camera.Rotation = scene.Camera.Rotation +2
Doesn't this (above) rotate really fast ? I seems like it would rotate 360° in less than a fifth of a second ? Also could you not get rid of the timer and simply rotate the camera in real time (rather than discrete steps) ?
For the actor at the top you could simply move him in a circular path travelling in the opposite direction to the world's rotational direction. Or maybe stick him on a non-movable layer ? Hard to really say without knowing what this actor is doing.
Yes, it rotate quite fast. But I can still change this. I placed a Timer on it because it will be rotating endlessly. I'm not sure how to do it without placing a Timer.
Oh Yes. Nice idea for the Actor. But even though I set the Actor as a Non-Movable Layer. It still rotates because of the camera itself is rotating. The actor will be set to jump and will travel on the rotating world. Imagine a clown on top of a ball.
Just need to know some lines of codes that I can use to "constrain" the top position of the character.
Thanks!
constrain X to Radius*cos(game.time*SpeedOfRotation)+XCentrePointOfOrbit.
constrain Y to Radius*sin(game.time*SpeedOfRotation)+YCentrePointOfOrbit.
I agree that we are all clowns in life. I'm not trying to disrespect clowns. But they are clowns aye and we are clowns? Haha.
Thanks again man!
I did not understand the
XCentrePointOfOrbit and YCentrePointOfOrbit
And for the Radius, you mean the radius of the Rotating World?
Thanks in Advance.
We are getting an object to travel in a circular path, CentrePointOfOrbit is the centre point of that circular path.
XCentrePointOfOrbit is the X position of the centre point of that circular path.
YCentrePointOfOrbit is the Y position of the centre point of that circular path.
I'd just use the X and Y coordinates of your rotating world as it lies at the centre of this circular path.
The 'Radius' is how far an object is from the centre point of its circular path, make it whatever you like.
Hope that helps.