Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Vallar · Dec 19, 2012 at 11:34 PM · 2dspace shooterplaymaker

Screen Wrap 2D Space Shooter Tut (Playmaker)

Hello,

I am a long time lurker of the Unity space and have been learning it for quite sometimes, I have started off with Playmaker as well and hit a bump.

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 doing 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 answers here, however couldn't find anything similar to this.

Thank you very much.

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Vallar · Dec 22, 2012 at 11:15 PM 0
Share

I moved the first three actions from the Listener state to the "Out Of Screen Left" state and it did the wrap up effect once, however it didn't loop over it, the box would continue moving forever off screen.

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Vallar · Dec 22, 2012 at 11:32 PM

Got the answer, in the Listener state I had the tolerance value for the float compare action set to 0.3 which would then prevent the continues movement as it checks against the current location + tolerance and doesn't move since both are equal to the position I am setting it on.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

9 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Assets/Scripts/PlayerController.cs(32,49): error CS0126: An object of a type convertible to `float' is required for the return statement 1 Answer

Fire limit in a Space shooter? 1 Answer

Evasive Maneuver to Space Shooter 2D. 1 Answer

How to remove a specific prefab from a List? 1 Answer

2d bullet shot at bullet emitter 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges