Forum rules - please read before posting.

Weird Highlighting Issue and Object: Change Material Isn't working for me.

I am using adventure creator to create a point and click adventure game for my ADV. Prototyping class, in which we build a game. I am quite familiar with AC but I am an aritst not a programmer. I am running into two main problems and this game is due by thrusday 3/19/15 so a quick response would be greatly appreciated.

When I mouse over a hotspot, a highlight on the hotspot's object appears. This is great and this is what I want. However, it is also highlighting other objects not related to the hotspot that I mouse over. I turned off the highlight script on the problem hotspot's object. However I'm still getting random objects highlighted when I interact with said hotspot. Once again the objects that are highlighting have nothing to do with the hotspot moused over or interacted with. Some of the objects affected by this have the highlight script and some dont. Some have regular diffuse materials and some have transparent cutout materials. I've tried to turn down the hotspot detection by the cursor and I'm still getting random highlighted objects. I do not have hotspot auto detect on the character because I am using mouse only not touch controls.

I am trying to use a Global Int to keep track of how many clicks are on my mushroom's hotspot and react accordingly based of the Int value. For instance, when clicked on it once, it changes the value to 1 in which it will do a check and if the value is at 1 "Object: Change Material" I know the Global variable works because I have it performing other things like playing animations and such. I have plugged in the mesh renderer as well as the material to change to and I get no change. I see there is a "material index" which has a value I can change. I do not know what this value's function serves but I changed the value anyway to see if affected chaning the material. Still nothing.

Any help would be greatly appreciated. Thank you.

Comments

  • Screenshots of these problems are always going to make things easier.  For your first problem, please post a shot of your Hotspot's inspector, and the hierarchy showing it's associated Higlight object.  For your Variable problem, a shot of your ActionList, and the inspector (with materials showing) of the object you're trying to affect.

    The Highlight component will brighten child objects as well as the object it's attached to (though in hindsight, this should probably be optional).  Are the other objects children of the intended one?

    The material index refers to which material slot you want to affect (starting from zero).  A mesh can have multiple materials, but if you only have one, just leave it at 0.  It's not clear whether your problem lies with this Action, or the Variable logic - to find out, temporarily replace the Object: Change material with an Engine: End game Action.  If the game quits, at least we know the logic works.
  • I created a video of the issues I am having. When I was done recording I realized some of the actionlist and inspector was cut off.


    So I have provided screenshots too.

    http://imgur.com/a/mWxl4

    Hope this helps and of course any help would be much appreciated. 
  • I have ran into another problem where I have multiple player starts. I have them set to what scene they are coming from as well as the camera I would like it to default to when that player start is used. When I test this it just jumps to the Main Camera and will not use any other camera no matter if it is hooked up to the player start script or not. Any suggestions? Sorry I'm having a lot of issues. Any help would be great. :(

    Screenshots
  • Thanks for the detailed video and shots - it helps a lot.

    Highlight issue
    This is probably happening because of your Hotspot settings in the Settings Manager.  Either you've got Hotspots being detected by Player Vicinity, or it's based on cursor proximity, and the proximity factor is too high.  It doesn't have anything to do with the Interaction itself - when the interaction runs, all highlight scripts turn themselves off.

    Material issue
    You can have as many materials on a mesh as you like, but each vertex is limited to just one.  So if you want to swap out the texture of the whole mesh, you want just one material.  It seems the problem is because you're trying to change the DustMush01 object, while it's DushMushroom (a child object) that actually has the material.  Use DushMushroom instead, and it should work.

    PlayerStart issue
    This could be quite a serious bug, though the fact that this hasn't been reported before gives me hope there's something simple that's been missed.  What's the actual position of the MainCamera?  Is that where it is when the scene isn't running?  If not, it has to be attached to one of your GameCameras, even if it's not the right one.  If you select the MainCamera when the game is running, you'll be able to check it's "Attached camera", or the one it's supposed to be copying - that may give a clue.  Other than that, try referring to your scenes by name - that won't be the proper solution, but it'll help narrow down the source of this problem.
  • Highlight Issue
    I don't have player vicinity on but I did have 'Highlight hotspots based on cursor proximity', in which I wanted to use. As I stated above I turned it way down but it still had the same effect. I turned it off and it fixed the problem. Thank you. 

    Material Issue
    I'm really glad it was simple step to fix this and thank you so much for your help. It works just fine!
    i do have another question though. Is there a way I could fade the materials into on another with AC? 

    PlayerStart Issue

    I've posted a video with my findings on looking more into the scene when it is being played. Found some interesting stuff. The Main Camera does have the correct Attached Camera for each secondary PlayerStart. I forgot to say that in the video but you can see it when I select the main camera while the game is running.
  • Material issue
    'Fraid not - a vertex can only have one material, not transitioning.  That's a Unity thing, not AC.

    PlayerStart issue
    OK, I think I see the problem.  So the two GameCameras moving is actually correct.  A GameCamera will still move by it's own rules even when it's not active - this is so that you can always find out what the MainCamera would do if you cut to it.

    The issue is to do with the player's "start point".  If a GameCamera moves relative to the player, you want it to behave the same way regardless of what the player's starting point was - otherwise you'll need to have a new camera for each PlayerStart (whether you want one or not).  So to combat that, you have the option at the bottom of the GameCamera to Use default PlayerStart?  This basically means it'll use the player's position relative to the default PlayerStart (not the actual one being used) to work out where it needs to be, so that it'll always be the same regardless of your scene.

    You might actually get lucky with unchecking that box on GameCamera2, but I doubt it.  So really, you have two options:

    1) The controls on GameCamera2 simply need to be adjusted once the game is running.  Get the values to what works, copy them, then paste them back in once the game stops running.

    2) Just use GameCamera1 for both PlayerStarts - as you said, it's pretty much in the right spot to begin with.
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.