Forum rules - please read before posting.

Draggable Move Sound generate 2d sound in 3d game. Pickups Questions. Set track Position bug?

Using: (AC 1.74.2) and Unity (2020, 5.f1) and UCC.

Useless intro:
Hi there! After many years making 2d games with AC, I'm making my first 3d one. (thanks as always for this amazing tool!)
Being two months setting up a player character with AC and UCC. Not many problems, looks like a solid integration. I wish I could have some premade AC actions to handle some UCC stuff but I'm using a Playmaker bridge that already has actions so as I'm useless with coding It's ok.

So, I've been some weeks setting up Draggables on all kind of tracks, great system (a bit hit and miss placing the correct track rotations tho).

After much trying I found these problems:

1. Draggable Move Sound Problem

While for example the Track Sound when Enters Region creates a One Shoot Sound with Spatial sound enabled etc and works well, the (Move Sound) of Draggables that is created, appears without Spatial Blend, 500 Max distance etc, that is ok for a 2d game but of course doesn't work for a 3d game (And also burns your ears when entering gameplay and you hear some distorted move sound from every draggable on all scene).

I don't know much about code but I investigated a bit:

DragTrack has on the code** "AudioSource.PlayClipAtPoint",** (referencing unity audiosource) while Move sound from Draggables is **moveSound.Play (moveSoundClip, true); **, (referencing inner AC sound system) so there may be the difference?

I was hoping there was some 3d-2d perspective autodetect in order to AC to know how to spawn the audio clip. or allow to add to use from audiosource example in the object It would be normal to control what audio source Distance have and spatial blend etc on a 3d game)

And Yes, I've put some AudioSource and AC Sound component on the Draggable to test, as the prefab Draggable has it, and it inherits the collide sound, but I've not tested extensively the Collide Sound from Draggables 'cause I don't use it, but looks like not sounding. Can't say for sure.

Also, move sound pitches really weird, I'll like to have more information on how to put a Move sound that sounds well.

2. Set track Position Action Bug?

I'm not sure if I'm not using this actions right, but this is how it works for me:

I choose a Draggable. Ok. If I choose a Drag Track (Optional), I can only set new Track position (in this example is 1) (is instant, and rest of options dissapear), and when I use the action on game, the transition from 0 to 1 is Instant (so no use to open a door, lets say.)

If I don't set the Drag Track Optional, Speed, Is Instant, etc options are visible, but for some reasons then, on gameplay, the draggable doesn't move.

Second part can be my problem, as I'm testing a lot of things and not payed enough attention to this, but all the options going away if the Drag Track is assigned in the action is as intended? (I can guess yes if it reads the Draggable Speed information and such but... I tried with various Draggables and the Action always move it to next region instanly).
(And I looked at the code and I don't understand it well enough).

3. Questions about Pickup

Also, I'm trying to make a good physics system with pickups so I have some questions.

Physics generally works. I've been trying some configurations of collider types (Convex mesh colliders, box colliders... Interpolate, Extrapolate, Different type of collision detections.. all works well but;)

  1. I don't exactly understand what Ignore Rigidboy Colliders do, despite reading the explanation and testing around. (Doesn't seem to change anything no matter how many things I try on another Moveables and colliders)

  2. (Probably UCC problem) Looks like Ignore player's collider doesn't work or I don't know how it is supposed to work. It is for third person stuff? I tried setting up the UCC character with Character Layer and Player Tag but the player collides the same grabbing or not grabbing the item... Looks like the Pickup always collide. How it is supposed to work? I've checked the code and looks for colliders on the children so... I also put the player capsule collider on those layer and tag to check but...
    It's a tag thing? Layer?
    How it is supposed to ignore the collider, like totally going thru it? (just to check if I make it work, I'm interested in all pickable collisions for this game).

  3. Any advice on making good world collisions while grabbing pickups? Collisions work fine when the player is not grabbing the object, as said at the start of the post. I tried all kind of collisions parameters to check how they fare better.
    I read around on the internet that there is ways, like make sure that the object never leaves the camera sight and goes back to last position on camera in order to not clip with walls and ground etc. I guess I could put some script of those inside grabbing AC script.

Well, that's it. I'll have a lot more questions in the future -_-

Thanks!

Comments

  • Draggable Move Sound Problem

    the (Move Sound) of Draggables that is created, appears without Spatial Blend, 500 Max distance etc

    You raise a good point. It'd probably be best to expose this as an optional field in the Inspector, with the MoveSound only being auto-generated if unassigned.

    move sound pitches really weird, I'll like to have more information on how to put a Move sound that sounds well.

    If the Pitch factor is greater than zero, the sound's pitch will be synced with the object's speed. Keep it low for a more subtle effect, and try assigning a longer AudioClip to avoid obvious looping.

    Set track Position Action Bug?

    If I don't set the Drag Track Optional, Speed, Is Instant, etc options are visible, but for some reasons then, on gameplay, the draggable doesn't move.

    I'd need to see the exact settings of the Action and the draggable, as well as details on when you're running this Action.

    What are your AC/Unity versions, and is the Action continuing to run during this time?

    all the options going away if the Drag Track is assigned in the action is as intended?

    The Drag Track assigned in this Action is being set as a "New Track" to assign for the Draggable - not the Track it's currently assigned to. When switching Track, the Draggable must be snapped onto it, so the effect has to be instantaneous.

    Questions about Pickup

    I don't exactly understand what Ignore Rigidboy Colliders do

    The "Ignore Player's Collider" and "Ignore Moveable Rigidbodies" options are both related to collision detection.

    "Ignore Player's Collider" is to prevent collisions between the PickUp and any Colliders associated with the Player (on the root or children).

    "Ignore Moveable Rigidbodies" is to prevent collision with any moveable object that has a Rigidbody. This includes other PickUps, Draggables and objects with Moveable components attached.

    (Probably UCC problem) Looks like Ignore player's collider doesn't work or I don't know how it is supposed to work.

    The operation doesn't involve Tags, Layers, or the camera perspective - it's a call to Unity's Physics.IgnoreCollision function (https://docs.unity3d.com/ScriptReference/Physics.IgnoreCollision.html).

    If you're spawning the UCC Player prefab at runtime, try keeping it in the scene to see if that makes a difference, but alternatives to checking the "Ignore Player's Collider" option would be to either call Physics.IgnoreCollision manually, or place the Player on its own Layer and configure the collision matrix to have this new layer ignore collisions with the one Hotspots are placed on.

    Any advice on making good world collisions while grabbing pickups?

    What issues are you having, and what is your AC version? The first port of call to improving collisions should be Unity's Physics and Time settings - in particular, try reducing the Fixed Timestep value.

  • My versions are in the top of the original post.

    1.Answers.

    You raise a good point. It'd probably be best to expose this as an optional field in the Inspector, with the MoveSound only being auto-generated if unassigned.

    I can just hide the move sounds while waiting for an update, so no problem. I'm just trying to have a well enough tech demo in a few months.

    The Drag Track assigned in this Action is being set as a "New Track" to assign for the Draggable - not the Track it's currently assigned to. When switching Track, the Draggable must be snapped onto it, so the effect has to be instantaneous.

    That explains it. I didn't understood what the Optional Drag Track meant. Then I just have to adjust the correct physics in order to use that action.

    "Ignore Player's Collider" is to prevent collisions between the PickUp and any Colliders associated with the Player (on the root or children).

    Yeah... My player is on scene, not a prefab. I don't really understand why it collides if that options are on. (for example, I can move backwards around the scene my character by moving the grabbing object closer to the character, or zooming the object... "like pushing myself". but it maybe be my problems: (For example, because the UCC or Final IK components collision-raycasting Default layers instead of using collider for collisions, etc... So I'll just keep investigating while making all my integrations work seamlessly.)

    What issues are you having, and what is your AC version? The first port of call to improving collisions should be Unity's Physics and Time settings - in particular, try reducing the Fixed Timestep value.

    Well, They're not issues with AC per se, but I could have to improve the physics of the grabbed object by the AC script. I'll study and test the matter for a time an open a post about it if needed. most important matter I need to fix is that if I hold a very little object with 1 of Mass, It could not be able to move a tank with 1000 mass while being held. I need to understand how object collision works while being held... I tried changing mass at runtime while held and is not that.

    2. An UCC-AC integration question about Draggable/Pickups:

    Unrelated to topic's name but the forum search is quite good for any other user looking for solutions so I'll ask here:

    Player movement Reduction and Player Motion Influence Of course doesn't work out of the bait as movement is controlled by UCC. (I say of course based on logic and just trying it a bit)

    As for Player Motion Influence:
    I guess it may be possible to add something on the AC-UCC integration script to translate the animator parameters of UCC in order to AC to at least know the player influence? Maybe just correlate some parameter name in AC code to let know what is current player motion speed based on UCC animator?

    As for Player Motion Reduction:
    I understand that Player movement Reduction would be quite harder as will meant trying to change UCC player motion?

    These are just curiosity questions in order to know if I could try to work on them or I better forgot with my amateur coding level.

    Lots of thanks, as always!

  • My versions are in the top of the original post.

    Quite right, apologies.

    I can just hide the move sounds while waiting for an update, so no problem.

    v1.74.3, out now, adds an optional Move Sound object field.

    I can move backwards around the scene my character by moving the grabbing object closer to the character, or zooming the object...

    It'd be worth creating a temporary AC-only Player character/scene so as to learn if another asset is involved here.

    most important matter I need to fix is that if I hold a very little object with 1 of Mass, It could not be able to move a tank with 1000 mass while being held

    I shall attempt a recreation of this issue. Can you share screens of the PickUp and tank's Inspectors?

    Player Motion Influence

    AC calculates the motion influence using the change in position of the Main camera transform. If this is being correctly read as the AC MainCamera, it should work regardless of the Player's motion controller.

    Player Motion Reduction

    The factor by which the Player's speed should be modified when dragging an object can be gotten by reading:

    AC.KickStarter.playerInput.GetDragMovementSlowDown ()
    

    UCC's docs/devs should be able to help you translate this into a means of modifying the UCC's Player speed.

  • edited November 2021

    Amazing! I've been checking since yesterday the improvements. I'll get back when I studied and tested enough the physics if I have some specific suggeriments that can go beyond my personal needs.

    For example, I noticed there is the lack of an important feature in the Pickables, there is no "Lock Camera" checkbox to allow or not the Rotation of the pickables.

    Blocking the camera own rotation is a common feature to not rotate the object and the camera at the same time. (Like in amnesia or every other game where you have to pay good attention to the object, or place it well). As in UCC+AC, AC controls the camera, I'll just have to script some lock camera rotation when start rotation and unlocking when ending the rotation button press.), But it would be a nice feature to have.

    Edit: Looks like the UCC integration is giving some problems tho... Not enough locking the camera position via AC.

  • edited November 2021

    I noticed there is the lack of an important feature in the Pickables, there is no "Lock Camera" checkbox to allow or not the Rotation of the pickables.

    If you're in AC's first-person mode while rotating a PickUp (with the RotateMoveable input), free-aiming will be locked automatically.

    It's also possible to disable free-aiming at all times while manipulating Draggables and/or PickUps under the Settings Manager's "Show Interface Settings" panel.

    These features are, however, for AC's built-in controller - they won't translate automatically to a separate motion controller asset.

    I shall look to see if the two can be synced better in the AC/UCC integration. I would still recommend testing your PickUps with AC's built-in first person controller (or the template on the Downloads page) to see which issues are AC-related and which are integration-related.

    On a related note, you may benefit from the First Person Primer tutorial, which covers the main topics of first-person games in AC. Though it sticks to AC as the main asset, it does detail the different ways Draggable and PickUp objects can be used.

  • I have updated the UCC integration package with (hopefully) a better sync between AC's cursor locking and UCC free-aiming.

  • You can safely avoid the first part of the post, not sure if you can find clues to any problem there or is just me. 2 Quick questions in the end.

    No integration questions right now; just letting you know my findings and troubleshooting.

    1. I had some days trying to understand where problems lied, as I noticed that my first problem (or not?) was that I was using Direct instead of First Person (as I first started trying the First/Third person integration). Also First Person mode only worked with Move-free aim values of 0, if not the controller would go bonkers.
      Now I set up correctly a only a First Person character.

    (As I was on Direct I couldn't see the "Disable free-aim when... " etc.)

    I was quite puzzled until I found that I needed to change both Free-aim speed parameters to 0 on the Settings in order to make First Person Movement move work with UCC ), but I finally did it, and now works the same that with my previous Direct, but with AC knowing that I'm on First Person, so that's something.

    (I had problems with the freshly imported AC-UCC demo managers too, the demo (first person only with First Person movement) wasn't working. Turns out was the free-aim speed thing)

    1. Also strangely and suddenly, (before the integration update, after last AC update) Both in Direct and First Person, no change in settings, when rotating an object, camera stops rotating (but the rotation of the object don't work quite well, as is constrained by some limits , Small objects rotate several times 360º but big objects barely rotate 20º. - ****(But I have to test a lot, doesn't matter now))****. I even reimported the original script, so I don't even know why now main camera rotation stops and didn't did it before. (I'm quite lost there).

    I have to make a lot of testing yet so.. No problems right now.

    And just some strange findings:

    1.When "Disallow free-aim when moving Draggables is on", Draggables barely move with previous parameters; I need to reduce their rigidbody nearly to mass 1 for them to move, when without disallowing free-aim when moving draggables, I can slowly move 400 mass rigidbody. Maybe this related to the motor influence? Is free-aim speed the motor infuence? (Would have sense since I need to put the free aim speed to 0)
    (Anyway, I'm not going to disallow free-aim when moving draggables on my game but I wonder why is this and if can become a problem in the future. My tests with motor influence has not been very successful up to now).

    2.I'm not sure what have you updated on the AC-UCC integration. I updated it but there were no change on scripts. So I deleted the old folder and update it... But I don't know if something has changed.

    Anyway, as said, not searching for any problem or solution now... Things kinda work.

    Some unrelated quick question:

    1
    In the manual there is a link for to use this script https://adventure-creator.fandom.com/wiki/Press_space_to_finish_loading that I'm interested on using but I think the code maybe be old cause

    "No overload for 'OnAwaitSceneActivation' matches delegate 'EventManager.Delegate_OnCompleteScenePreload'"

    2
    Where do one put custom scripts for menus? (Like inventory box element custom script). In the canvas of the menu, in a gameobject in the scene...? I was trying some script found on the forums and looks like I don't really know where it goes to make it work.

    Thanks!

  • Thanks for the feedback.

    It's hard to pin down the exact source of your control issues, as both AC and UCC, as well as the unique settings of your project, are all contributing.

    The ability to free-aim or not while dragging shouldn't typically have much of an affect on the behaviour of the draggable itself, but I'd recommend looking at the "Movement input" field in any Track Inspector you're using. It may be that setting this to Cursor Position, instead of Drag Vector, improves behaviour.

    In the manual there is a link for to use this script https://adventure-creator.fandom.com/wiki/Press_space_to_finish_loading that I'm interested on using but I think the code maybe be old cause

    Thanks for the alert - AC's API changed since the script was written. I've updated the script with the relevant corrections.

    Where do one put custom scripts for menus?

    If you want to affect the Menu while it's not currently visible, or if it's an AC menu, then the script needs to be present in the scene file (on e.g. an empty GameObject), or on a persistent object (such as attached to AC's PersistentEngine prefab).

    If the script only affects the Menu while it's visible, and the Menu uses Unity UI, then it can go inside the Canvas prefab's hierarchy. Where exactly it goes depends on the script, but in most cases the root is enough. Which script are you looking to use?

  • edited December 2021

    Just a quick question.....

    The UCC integration is being a pass in the ass, not because AC per se, but the system is made of paper glass in his relation with its own camera and game manager.

    I'm fighting now with the most and last important part of the integration; saving. (via AC). Turns out the UCC player and its external components have to be on scene or be spawned in a very specific break so random things don't break; I need to check a lot of different workarounds.

    One of them is trying to use the character as a prefab, but not as a player prefab via AC, Or even, load the character via an additional scene (not active scene) just to leave it as a Don't Destroy object.

    AC player work out of the box if is in present on scene, or is a player prefab handled via AC but, for those other circustances **, is there any command on AC to force select what is the player? I've been looking in the documentation and didn't found, as is not the intended way. **

    BTW: All this problems are due how Lightmapping gives a lot of problems with multiple scenes, and AC player scene needed to be the main one, if not would be easy, as I worked for months just having the player on a dedicated scene and loading the proper levels as additive scenes.

  • edited December 2021

    I'll urge caution using this, but you can override AC's record of the active Player character by setting the value of:

    AC.KickStarter.player
    

    The Player this is set to will need to be present, however - this should not be set directly to a prefab.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.