Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

Author Topic: Game Main object  (Read 2348 times)

0 Members and 1 Guest are viewing this topic.

eborr

  • Regular poster
  • ***
  • Karma: 4
  • Offline Offline
  • Posts: 196
    • View Profile
Game Main object
« on: August 30, 2010, 05:59:00 PM »

Hello I have been struggling for a couple of hours with a problem, which is that if I change the identity of an actor with the line
 actor = Game.LoadActor("actors/r1/r1.actor");
initially everything seems to be fine, the new actor appears, and moves around, however the scrolling of the screen stops, after much trial and error I discovered you had to put in the line

Game.MainObject = actor;

is there an explanation for this behaviour in that the association of Game.MainObject is established in Game.script.
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Game Main object
« Reply #1 on: September 01, 2010, 10:01:27 AM »

Since you can have many actors in your scene, but the camera can only focus on one of them, you need to specify which one using the Game.MainObject property. When you destroy the actor, this reference becomes invalid and you need to assign a new one.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
 

Page created in 0.041 seconds with 20 queries.