Home    LittleBigPlanet 2 - 3 - Vita - Karting    LittleBigPlanet 2    [LBP2] Help!
#1

limit a cursor

Archive: 2 posts


Im making a game that uses a cursor but how do I make so the cursor doesnt move any further within a specific area?
for exempal: I have a holografic cursor thats controlled by a receiving controlinator that I want to stay within a circle.
when the curser reaches any of the circles corners it doesnt move any further. how do I do that?
its like what Mm did in the story level "got the hump"
2011-02-03 13:59:00

Author:
Unknown User


One way of doing this is to make a bounding box out of invisible holo material to surround the area you want the cursor to stay within. Put a tag on the bounding holo, 'Limit', or whatever you want to call it.

In the middle of the cursor move-able area put another tag, 'Cursor Home', or whichever name is good. On the cursor put an impact sensor that includes touching and it keyed to activate on tag 'Limit'.

The output of the Limit impact sensor is wired into a Follower that will follow the Cursor Home tag. Set the acceleration to something like 80% - 90% and the speed between 3 - 6. (You can play with the speed and accel values to get the effect you want.)

When the cursor hits the bounding box it will try to move the cursor back to the tag in the middle of the area. This return movement stops as soon as the cursor is back in the playable area.

If the speed and/or accel values are high then when the cursor hits the bounding box it will bounce back. If the values are a bit lower then it will kind of just hit a wall. You need to make sure that your advanced mover that is controlling the cursor has its values set with max speed and accel so that it will not overpower the force applied when the bounding box is hit or the cursor will just go through.
2011-02-03 17:05:00

Author:
Trindall
Posts: 297


LBPCentral Archive Statistics
Posts: 1077139    Threads: 69970    Members: 9661    Archive-Date: 2019-01-19

Datenschutz
Aus dem Archiv wurden alle persönlichen Daten wie Name, Anschrift, Email etc. - aber auch sämtliche Inhalte wie z.B. persönliche Nachrichten - entfernt.
Die Nutzung dieser Webseite erfolgt ohne Speicherung personenbezogener Daten. Es werden keinerlei Cookies, Logs, 3rd-Party-Plugins etc. verwendet.