• 🏆 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!

Camera Help

Status
Not open for further replies.
Level 2
Joined
Aug 4, 2009
Messages
8
im trying to make a 3rd person camera and i have no idea were to start on the trigger for it, if anyone can help that would be awsome :grin:
 
Level 5
Joined
Apr 8, 2006
Messages
130
triggerx.jpg



I think that should do it, just with the selected player and unit you want. You might want to the change the event to periodic event - every 0.1 seconds so that it keeps refreshing incase something goes wrong. I'll have a look at how to lock it behind the target now, just need to test it out on WE.

trigger2.jpg

I'd advise changing the 0.00 seconds to 0.1 on the event.. i forgot to when i just made this trigger but it makes it much smoother.

There ya go, that should lock the camera behind a unit. This is a basic third person camera, you can add stuff like distance to target through the "Camera -Set Camera Field"


If you need to know anything else just message me.
 
Last edited:
Level 2
Joined
Aug 4, 2009
Messages
8
is there a way to make it more...general? like instead of being a specific unit can it be a type of unit or a unit owned by a player?
 
Level 10
Joined
Jan 28, 2009
Messages
442
It has to be specific. You can't lock a player's camera to all units of a type, or all units owned by a player. Only one unit. But you should probably attach the unit to a variable.

  • Events
    • Selection - A player selects a unit
  • Conditions
    • Unit type of triggering unit is equal to Knight of the Desert
    • Triggering player is equal to owner of triggering unit
  • Actions
    • Set CamTarget(player number of triggering player) = triggering unit
This is just an example of how you can determine the camera's target dynamically.

  • Events
    • Every 0.01 seconds of the game
  • Conditions
  • Actions
    • Set TempForce = all players of user control
    • Pick every player in TempForce and do actions
      • Camera - stop the current camera for picked player
      • Camera - set picked player's camera rotation equal to facing angle of CamTarget(player number of picked player) over 0.5 seconds
    • Custom script: call DestroyForce(udg_TempForce)
Now the camera is attached to our dynamically determined unit. Furthermore, I made this trigger so that the rotation will go even more smoothly and look better. It constantly stops the camera, and then starts rotating it over 0.5 seconds. Trust me, it will look good.
I'm sorry if the functions don't match those in the editor 100%.

If you tell me more specifically what you want to make, I can help you more.
 
Level 2
Joined
Aug 4, 2009
Messages
8
well i need a camera trigger that is locked onto the current unit owned by the player and when you move your current unit into the selection area and it selects the other unit ,which spawns in a diffrent place, for the camera to follow and be behind that unit instead of the previous.
 
Status
Not open for further replies.
Top