• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] movement system with no collision

Status
Not open for further replies.
Level 3
Joined
May 7, 2005
Messages
36
Now I've created a movement system using the arrow keys, much like whats been seen before, however if the unit gets too close to an object or doodad it turned away and trys to find a way around. A collision, how do I rid of this? I've tried making the unit have no collision to no success. I'd like the unit to keep trying to go into that object without straying path, just kinda running into it.
 
Level 12
Joined
Mar 23, 2008
Messages
942
Try to detect with side the unit is coming from the object and them increase the move order per second based in how long the player press the arrow key.

Explain:
Unit find a block | |(block) O(unit)
You press left | |O

So the game detect you are coming from right, and send a order to unit move facing 50 offset left from block. And add +50 range each second the player still the left arrow key pressed, so if the block have 90range of side, if you press the arrow key for 2s the unit will eventually avoid the block and go to the other side.
 
Status
Not open for further replies.
Top