My sprite follows the mouse, but also at the same time it would be moving. if you've ever played call of duty and you've used a sniper, you'll know that the sniper scope always move around. so is there any way to make my cursor move all over, possibly in a path. around the mouse, but also still follow the mouse
Offline
that helps yes...but i'm not sure how to make it for a one dot? one big dot....
Offline
set mouseX to the mouse's X position, mouseY to the Y
Then set the cursor to MouseX + random -2 to 2 (adjust for amount of wobble)
and obviously set cursor Y to Mouse Y + random -2 to 2
thus you could simulate strong wind blowing the barrel, an explosion nearby shaking the scope like crazy, a heavily wounded soldier having a tendancy to droop the barrel, I dunno, all kinds of stuff. You could also make it so when you moved and then stopped the scope, it bobbles a little before it mostly settles down. Lower level players have shakier scopes.. ok, I'm rambling. Oh yeah, you could make it so that once it has 'wobbled so far away from it's original position, it stops drifting.
Offline
thats really good but is there any way to slow it down?
Offline
I didn't write the script, but I think you could just put a <wait(0.1 )secsc> at the end of the script (at the bottom of the forever block.
Offline
MoreGamesNow wrote:
I didn't write the script, but I think you could just put a <wait(0.1 )secsc>[/blocks] at the end of the script (at the bottom of the forever block.
I'm not sure that would do anything... If anything, it would slow it down.
Offline
i've put on wait 0.1 but basicly it makes it look laggy, it jumps one spot to the other
Offline
Don't make it jump all the way by go to mouse. Set the direction towards the mouse, save the distance as a variable then only move a percentage of that variable. You may want to encase that move inside an "if distance (from target spot) > than (some small number)"
That number will be how close it has to be before it quits only going part of the distance.
Hope this makes sense, I'm just thinking off the top of my head lol.
Offline
It depends on how complex you wanted to get. You could make a pretty complicated script that included velocity, movement of the scope based on mouse movement, etc.
For example, based on what some others have said, you could have the scope lag behind the cursor, and then overshoot a bit, and bobble back and forth slower and slower. (Just a thought)
Offline