playMaker

Author Topic: Translate Per Second [SOLVED]  (Read 7340 times)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Translate Per Second
« Reply #15 on: May 30, 2014, 08:08:14 AM »
Hi,

 Indeed, well spotted. Typically, this is why I recommend using tweening engines for this, because they enforce reaching the end value perfectly ( at least that's my experience of it, maybe not all tweening engines do so).

 Here, because we are using timed event, the last frame is never likely to properly be of the right amount, this coupled with a potential small imperfection in timing within PlayMaker internal management of time ( I mentionned it on the beta list).

 Typically, and I didn't for this example, cause that's nto the point, I would enforce upon exiting the translate routine to position the gameobject where it's now suppoed to be perfectly.

also, bear in mind that the offset is like really small, so I don't think it really affects the game play isn't it? or are you looking for absolute precision here?

bye,

Jean

coxy17

  • Beta Group
  • Sr. Member
  • *
  • Posts: 355
Re: Translate Per Second
« Reply #16 on: May 30, 2014, 09:15:52 AM »
Hi Jean,

I understand what you are saying. i am after an absolute positioning in my case.

Reason is that i have a grid based game and from the players birds eye view they land on a block which is precisely centre. I have already thought about the fact why do i need to be e.g. on 10 and if its on 10.1 why should i be bothered.

One scenario is the player keeps going forward without making any turns and then will end up being very offset.
e.g. 0 > 10.04 > 20.1 > 30.12 > 40.2 ........end up being 130.5 or something

Couldnt i set a trigger up on each square in my grid and have the trigger drag the player back to the centre when idle? or player decides to stop. Not a great idea i know lol

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Translate Per Second
« Reply #17 on: May 30, 2014, 09:31:50 AM »
Hi,

 not a problem. As I said, simply add a repositioning action when you leave the translate state. And if you are using a grid based, I am sitll unsure why you don't want to use an iTween call?

Also, you may want to look at some grid systems on the asset store, it seems you could speed up your process by using a framework.

Bye,

 Jean

coxy17

  • Beta Group
  • Sr. Member
  • *
  • Posts: 355
Re: Translate Per Second
« Reply #18 on: June 03, 2014, 08:42:02 AM »
Hi Jean,

Ive taken a look and ive just kept your translate action as it works for me :)

Ive added a Trigger which re-positions the player upon stopping. Like you said the numbers only minute and when i update the position you cant tell the player had moved. Also collisions work fine with this method. Not painful iTween setup, as it would require me to study more lol

Just out of curiosity before i put this to solved, if i have loads of Triggers will this cause performance issues?

Nick

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Translate Per Second
« Reply #19 on: June 03, 2014, 09:27:48 AM »
Hi,

 lots of triggers are fine, as long as yo uonly use enter and exit events, not "stay", which is a bit of a problem performance wise if abused.

Bye,

 Jean

coxy17

  • Beta Group
  • Sr. Member
  • *
  • Posts: 355
Re: Translate Per Second
« Reply #20 on: June 03, 2014, 09:44:26 AM »
thanks, that's good news i only need the enter/exit