playMaker

Author Topic: switching between scenes [SOLVED]  (Read 1854 times)

colpolstudios

  • Sr. Member
  • ****
  • Posts: 370
switching between scenes [SOLVED]
« on: November 05, 2019, 05:54:14 PM »
In my current project, I was switching / loading a new scene in regard to allowing the user to change joystick buttons.

I quickly found out that switching back to the main scene required possibly a lot of extra work.

I had a number of enemy targets and you may have hit one or more, but when you returned to play they are still there.

I am using this approach now:

One scene.

The controller aspect with the buttons and its own camera the ability to remap buttons.

The player who has his own camera and each weapon you use.

The environment: holds the ground, enemy targets and surrounding walls.

When the controller aspect is in use. I reposition the environment and disable the player.

Then when you need to play.

deactivate the controller and reposition the environment and activate the player.

I am curious as to what you think and possible suggestions that you use.

you can test it here: https://simmer.io/@colpolstudios/mechanim-simple-ik-v-06


Remember its a wip
 



« Last Edit: November 15, 2019, 05:27:24 PM by colpolstudios »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: switching between scenes
« Reply #1 on: November 06, 2019, 02:21:43 AM »
Hi,

I think you could do that a lot simpler.

 have your player and camera agnostic to the user inputs. and have two different gameobject, one using mouse and one using joystick. simply enabledisable them based on the user selection.

these inputs gameobject will control the camera and player which are exposing variables that are expected to be controlled from outside.

 for your player, for example: Speed, Direction
 For your camera: direction

your input gameobjects would also fires global events like "USER INPUT / FIRE" or something, then your player can catch it and the player doesn't care how that event was sent and why it was sent.

Bye,

 Jean

colpolstudios

  • Sr. Member
  • ****
  • Posts: 370
Re: switching between scenes
« Reply #2 on: November 06, 2019, 07:06:40 AM »
My player is still under development so not prefab YET.

In the attached screenshot you will see the mouse and joystick controls are children.

I wanted the end user to only have to worry about placing the prefab into the scene and they are god to go!

I am currently using a lot of global variables and have read that this approach has issues and should be revised.

The scene is where you setup the player and test it out, so I can see the benefits of moving the mouse control to away from the player.

Mouse control remains constant and you are unable to change the keys in use.

The joystick control comes into play more due to the fact you have to actually play and try out and possibly change the buttons.

Then at some point the end user would have created a new scene that would come into play once they are happy with the controls they have setup.

Hope i'm making sense?

Thanks for your feedback and time.

Kind regards

colpolstudios   

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: switching between scenes
« Reply #3 on: November 08, 2019, 01:39:08 AM »
Hi,

 being under development doesn't necessary imply you must work outside prefabs. sometimes prefabs bring their own problems, so the sooner the feature works as it's intended, the better.

If indeed, both contexts are very different, then why not, and using placeholders like you did make sense, however I would move the player instead of the whole world, that seems more intuitive this way.

Bye,

 Jean