I asked this in my previous thread, but it went unanswered. There is an article here about the object, but is outdated and the example file is no longer available.
I am looking to use it with 360 degree aiming. Basically, just firing an object from the end of a gun at the same angle as the gun, toward the target reticle. How would I accomplish this?
I am just looking into a working 360 aim/firing system. Most posted here don't take into account that the speed of the bullets affected how they will collide with obsticles/enemies. I tried using a fastloop and while it works better, still doesn't work 100% of the time.
Using Fastloops or Move Safely will give you exactly the same effect and will work 100% of the timeif done correctly, the only difference is that Move Safely is a much easier option, however I don't have any experience with it myself sorry
I have just experimented with the object and have worked out what you need to do!
When you press fire, create the bullet object and also:
move safely->add to protection (bullet) [set the step distance here, 1 being most accurate]
move safely->prepare safety
bullet->move (Your code, set the position of the bullet off the screen in the direction it should move)
move safely->commence safety procedure
Now you can add the condition 'move safely->On Safety' and add the bullet collision events as this is the point at which the bullet is moving.
I hope this helps you!!
P.S. There are example files for this object in your MMF directory
Perhaps you could explain the fastloop solution to me. How should I set it up so that the bullet will move fairly fast and have pixel perfect collision?
• On Loop "Move"
→ set X_Pos("bullet") to X_Pos("Bullet") + (Cos(Angle("Bullet")) * (Velocity("Bullet") / #Steps))
→ set Y_Pos("bullet") to Y_Pos("Bullet") - (Sin(Angle("Bullet")) * (Velocity("Bullet") / #Steps))
→ set Bullet: X position to X_Pos("Bullet")
→ set Bullet: Y position to Y_Pos("Bullet")
It's not technicallly "pixel-perfect" (unless #Steps >= Velocity), but it's good enough, and potentially faster.
As with the MoveSafely extension, the fewer steps you use, the more efficient and less precise it is.