playMaker

Author Topic: [SOLVED]Screen Wrap action  (Read 2921 times)

Vallar

  • Junior Playmaker
  • **
  • Posts: 90
[SOLVED]Screen Wrap action
« on: December 21, 2012, 04:29:15 AM »
A week ago I found out about Playmaker and thought to give it ago, so I started with the video tutorials on Youtube and then thought I should advance a bit, currently I am following the 2D Space Shooter tutorial at 3D Buzz, here is the link: http://www.3dbuzz.com/vbforum/sv_showvideo.php?v=3594

The tutorial has this feature of screen wrap where when the player moves off the right hand side of the screen, they would appear on the left side and vice versa. I have been able to code through the part where it would set the position, however after setting the position, the object freezes and doesn't move again.

I was able to mimic the code written to move the cube just fine, however it goes off screen, then I tried to add a "Set Position" state to do the wrap effect, however after executing the "teleport" code, the cube freezes.

Here is the main state I start with (which works fine for normal movement): Simple float compare to compare the position of the object at a given time vs the position of it when it is outside of the screen.




Here is the other state to set position for when object is outside the screen (and the whole FSM):



Not sure how to get it moving again after it wraps using Playmaker.

I already searched through the forums here, however couldn't find anything similar to this.

Thank you very much.
« Last Edit: December 22, 2012, 06:26:00 PM by Vallar »

Vallar

  • Junior Playmaker
  • **
  • Posts: 90
Re: Screen Wrap action
« Reply #1 on: December 22, 2012, 06:12:53 PM »
Bump, still looking for a solution to this. Anyone has an idea about what is wrong?

Vallar

  • Junior Playmaker
  • **
  • Posts: 90
Re: [SOLVED]Screen Wrap action
« Reply #2 on: December 22, 2012, 06:27:00 PM »
Was missing the tolerance of the float itself as it was set to 0.3 as such current position + tolerance didn't allow the cube to move after the teleportation as the tolerance + current position = the position I set it to, to emulate the screen wrap effect.